diff --git a/dockerfile/cargo/Dockerfile b/dockerfile/cargo/Dockerfile index c26f81f..fb33e93 100644 --- a/dockerfile/cargo/Dockerfile +++ b/dockerfile/cargo/Dockerfile @@ -132,6 +132,19 @@ RUN bash -c 'set -eux;\ elif [ "${TARGETARCH}" = "amd64" ]; then export ARCH=x86_64; fi;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do LIB="$(eval "echo "$LIBRARY"")"; cp $LIB /root/lib/; done' +# Copy over directories +RUN mkdir -p /root/dir_abs && touch /root/dir_abs.list +ARG DIRECTORIES +ENV DIRECTORIES_ENV ${DIRECTORIES} +RUN bash -c 'set -eux;\ + DIRECTORIES_ARR=($DIRECTORIES_ENV);\ + i=0;\ + for DIRECTORY in "${DIRECTORIES_ARR[@]}"; do \ + cp -R $DIRECTORY /root/dir_abs/$i;\ + echo $DIRECTORY >> /root/dir_abs.list;\ + ((i = i + 1));\ + done' + # Use minimal busybox from infra-toolkit image for final scratch image FROM ghcr.io/strangelove-ventures/infra-toolkit:v0.0.7 AS infra-toolkit RUN addgroup --gid 1025 -S heighliner && adduser --uid 1025 -S heighliner -G heighliner @@ -203,19 +216,6 @@ RUN bash -c 'set -eux;\ fi;\ done' -# Copy over directories -RUN mkdir -p /root/dir_abs && touch /root/dir_abs.list -ARG DIRECTORIES -ENV DIRECTORIES_ENV ${DIRECTORIES} -RUN bash -c 'set -eux;\ - DIRECTORIES_ARR=($DIRECTORIES_ENV);\ - i=0;\ - for DIRECTORY in "${DIRECTORIES_ARR[@]}"; do \ - cp -R $DIRECTORY /root/dir_abs/$i;\ - echo $DIRECTORY >> /root/dir_abs.list;\ - ((i = i + 1));\ - done' - # Build final image from scratch FROM scratch