docker: Reduce more copies.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-05-30 22:44:05 +00:00
parent 288c49c436
commit 2be61de70f
4 changed files with 13 additions and 4 deletions

View File

@@ -61,6 +61,8 @@ ARG CARGO_INSTALL_ROOT
ARG install_temp="/usr/src/tuwunel/install"
WORKDIR /
COPY --link --from=input . .
RUN \
--mount=type=bind,from=output,src=${install_temp},dst=/mnt/install \
<<EOF

View File

@@ -6,7 +6,7 @@ ARG git_checkout
WORKDIR /
COPY --link --from=input . .
ADD --keep-git-dir . /usr/src/tuwunel
ADD --link --keep-git-dir . /usr/src/tuwunel
WORKDIR /usr/src/tuwunel
RUN <<EOF
set -eux
@@ -29,6 +29,9 @@ ARG JEMALLOC_OVERRIDE
#ARG ZSTD_SYS_USE_PKG_CONFIG=0
#ARG ROCKSDB_LIB_DIR
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
COPY --link --from=source /usr/src/tuwunel .
@@ -62,6 +65,9 @@ ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \

View File

@@ -5,6 +5,9 @@ ARG var_cache
ARG var_lib_apt
ARG packages
WORKDIR /
COPY --link --from=input . .
ENV packages="\
bzip2 \
ca-certificates \
@@ -21,9 +24,6 @@ xz-utils \
${packages} \
"
WORKDIR /
COPY --link --from=input . .
RUN \
--mount=type=cache,dst=${var_cache},sharing=locked \
--mount=type=cache,dst=${var_lib_apt},sharing=locked \

View File

@@ -283,6 +283,7 @@ target "tuwunel" {
target = "tuwunel"
dockerfile-inline =<<EOF
FROM input AS tuwunel
COPY --link --from=input . .
EXPOSE 8008 8448
ENTRYPOINT ["${cargo_install_root}/bin/tuwunel"]
EOF