Skip to content

Commit

Permalink
fix directory add in cargo buildkit dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Jun 13, 2023
1 parent 44ca508 commit 69097cb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions dockerfile/cargo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 69097cb

Please sign in to comment.