docker: Reduce more copies.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -61,6 +61,8 @@ ARG CARGO_INSTALL_ROOT
|
|||||||
ARG install_temp="/usr/src/tuwunel/install"
|
ARG install_temp="/usr/src/tuwunel/install"
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
COPY --link --from=input . .
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=bind,from=output,src=${install_temp},dst=/mnt/install \
|
--mount=type=bind,from=output,src=${install_temp},dst=/mnt/install \
|
||||||
<<EOF
|
<<EOF
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ ARG git_checkout
|
|||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --link --from=input . .
|
COPY --link --from=input . .
|
||||||
|
|
||||||
ADD --keep-git-dir . /usr/src/tuwunel
|
ADD --link --keep-git-dir . /usr/src/tuwunel
|
||||||
WORKDIR /usr/src/tuwunel
|
WORKDIR /usr/src/tuwunel
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
set -eux
|
set -eux
|
||||||
@@ -29,6 +29,9 @@ ARG JEMALLOC_OVERRIDE
|
|||||||
#ARG ZSTD_SYS_USE_PKG_CONFIG=0
|
#ARG ZSTD_SYS_USE_PKG_CONFIG=0
|
||||||
#ARG ROCKSDB_LIB_DIR
|
#ARG ROCKSDB_LIB_DIR
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
COPY --link --from=input . .
|
||||||
|
|
||||||
WORKDIR /usr/src/tuwunel
|
WORKDIR /usr/src/tuwunel
|
||||||
COPY --link --from=source /usr/src/tuwunel .
|
COPY --link --from=source /usr/src/tuwunel .
|
||||||
|
|
||||||
@@ -62,6 +65,9 @@ ARG RUSTUP_HOME
|
|||||||
ARG CARGO_HOME
|
ARG CARGO_HOME
|
||||||
ARG CARGO_TARGET
|
ARG CARGO_TARGET
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
COPY --link --from=input . .
|
||||||
|
|
||||||
WORKDIR /usr/src/tuwunel
|
WORKDIR /usr/src/tuwunel
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ ARG var_cache
|
|||||||
ARG var_lib_apt
|
ARG var_lib_apt
|
||||||
ARG packages
|
ARG packages
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
COPY --link --from=input . .
|
||||||
|
|
||||||
ENV packages="\
|
ENV packages="\
|
||||||
bzip2 \
|
bzip2 \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -21,9 +24,6 @@ xz-utils \
|
|||||||
${packages} \
|
${packages} \
|
||||||
"
|
"
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
COPY --link --from=input . .
|
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,dst=${var_cache},sharing=locked \
|
--mount=type=cache,dst=${var_cache},sharing=locked \
|
||||||
--mount=type=cache,dst=${var_lib_apt},sharing=locked \
|
--mount=type=cache,dst=${var_lib_apt},sharing=locked \
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ target "tuwunel" {
|
|||||||
target = "tuwunel"
|
target = "tuwunel"
|
||||||
dockerfile-inline =<<EOF
|
dockerfile-inline =<<EOF
|
||||||
FROM input AS tuwunel
|
FROM input AS tuwunel
|
||||||
|
COPY --link --from=input . .
|
||||||
EXPOSE 8008 8448
|
EXPOSE 8008 8448
|
||||||
ENTRYPOINT ["${cargo_install_root}/bin/tuwunel"]
|
ENTRYPOINT ["${cargo_install_root}/bin/tuwunel"]
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user