Add /tmp dir to Docker image (#506)

fixes #462

Co-authored-by: Andrés Maldonado <maldonado@codelutin.com>
This commit is contained in:
am97 2022-08-31 08:07:29 +02:00 committed by GitHub
parent 3588502c50
commit 31520b1afd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ ARG PUID=5000 \
PGID=5000 \ PGID=5000 \
RUNAS RUNAS
RUN mkdir -p /tmp/useradd && \ RUN mkdir -p /tmp/useradd /tmp/empty && \
if [ ! -z "$RUNAS" ]; then \ if [ ! -z "$RUNAS" ]; then \
echo "${RUNAS}:x:${PUID}:${PGID}::/nonexistent:/sbin/nologin" >> /tmp/useradd/passwd && \ echo "${RUNAS}:x:${PUID}:${PGID}::/nonexistent:/sbin/nologin" >> /tmp/useradd/passwd && \
echo "${RUNAS}:!:::::::" >> /tmp/useradd/shadow && \ echo "${RUNAS}:!:::::::" >> /tmp/useradd/shadow && \
@ -29,6 +29,7 @@ FROM scratch AS final
LABEL maintainer="Andrea Spacca <andrea.spacca@gmail.com>" LABEL maintainer="Andrea Spacca <andrea.spacca@gmail.com>"
ARG RUNAS ARG RUNAS
COPY --from=build /tmp/empty /tmp
COPY --from=build /tmp/useradd/* /etc/ COPY --from=build /tmp/useradd/* /etc/
COPY --from=build --chown=${RUNAS} /go/bin/transfersh /go/bin/transfersh COPY --from=build --chown=${RUNAS} /go/bin/transfersh /go/bin/transfersh
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt