Skip to content

Commit 92c0499

Browse files
committed
pack: fix packing in docker
Copy tarantool include files from tarantool build image. Install required dependencies for building rocks.
1 parent de1760d commit 92c0499

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

cli/pack/common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var (
4242

4343
packageBinPath = ""
4444
packageModulesPath = ""
45+
packageIncludePath = ""
4546

4647
packageInstancesEnabledPath = ""
4748

@@ -217,6 +218,7 @@ func createPackageStructure(destPath string, cartridgeCompat bool) error {
217218
packageVarDataPath,
218219
packageBinPath,
219220
packageModulesPath,
221+
packageIncludePath,
220222
packageInstancesEnabledPath,
221223
packageVarVinylPath,
222224
packageVarWalPath,
@@ -454,6 +456,7 @@ func prepareDefaultPackagePaths(opts *config.CliOpts, packagePath string) {
454456

455457
packageBinPath = filepath.Join(packagePath, configure.BinPath)
456458
packageModulesPath = filepath.Join(packagePath, configure.ModulesPath)
459+
packageIncludePath = filepath.Join(packagePath, configure.IncludePath)
457460

458461
packageInstancesEnabledPath = filepath.Join(packagePath, configure.InstancesEnabledDirName)
459462
}

cli/pack/docker.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ func PackInDocker(cmdCtx *cmdcontext.CmdCtx, packCtx *PackCtx,
9999

100100
// If bin_dir is not empty, we need to pack binaries built in container.
101101
relEnvBinPath := configure.BinPath
102-
ttPackCommandLine = append([]string{"/bin/bash", "-c",
103-
fmt.Sprintf("cp $(which tarantool) %s && cp $(which tt) %s && %s",
104-
relEnvBinPath, relEnvBinPath, strings.Join(ttPackCommandLine, " "))})
102+
ttPackCommandLine = []string{"/bin/bash", "-c",
103+
fmt.Sprintf(`cp $(which tarantool) %s && \
104+
cp $(which tt) %s && \
105+
cp -r /usr/local/include ./include/ && \
106+
%s`, relEnvBinPath, relEnvBinPath, strings.Join(ttPackCommandLine, " "))}
105107

106108
// Get a pack context for preparing a bundle without binaries.
107109
// All binary files will be taken from the docker image.

cli/pack/templates/Dockerfile.pack.build

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ FROM --platform=linux/amd64 ubuntu:20.04
3131
COPY --from=tt-builder /usr/bin/tt /usr/bin
3232

3333
COPY --from=tarantool-builder /usr/bin/tarantool /usr/bin
34+
COPY --from=tarantool-builder /usr/src/tarantool/include /usr/local/
3435

3536
WORKDIR /usr/src/{{ .env_dir }}
3637

37-
RUN apt update && apt install -y cpio binutils
38+
ENV DEBIAN_FRONTEND="noninteractive"
39+
40+
RUN apt update && apt install -y git build-essential cmake make cpio binutils curl unzip

0 commit comments

Comments
 (0)