Merge pull request #2309 from polarathene/chore/dockerfile-improved-copy

chore: Use a single `COPY` by better leveraging `.dockerignore` patterns
This commit is contained in:
Dirk Wetter 2023-02-07 12:23:04 +01:00 committed by GitHub
commit 8260ca16e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -1,2 +1,11 @@
# Exclude everything from the Docker build context:
*
# Except for this content:
!bin/
!etc/
!testssl.sh
# But additionally exclude this nested content:
bin/openssl.Darwin.* bin/openssl.Darwin.*
bin/openssl.FreeBSD.* bin/openssl.FreeBSD.*

View File

@ -10,9 +10,8 @@ RUN apk update && \
USER testssl USER testssl
WORKDIR /home/testssl/ WORKDIR /home/testssl/
COPY --chown=testssl:testssl etc/. /home/testssl/etc/ # Copy over build context (after filtered by .dockerignore): bin/ etc/ testssl.sh
COPY --chown=testssl:testssl bin/. /home/testssl/bin/ COPY --chown=testssl:testssl . /home/testssl/
COPY --chown=testssl:testssl testssl.sh /home/testssl/
ENTRYPOINT ["testssl.sh"] ENTRYPOINT ["testssl.sh"]