Skip to content

Commit 8260ca1

Browse files
authored
Merge pull request #2309 from polarathene/chore/dockerfile-improved-copy
chore: Use a single `COPY` by better leveraging `.dockerignore` patterns
2 parents 363c0d0 + 81634ce commit 8260ca1

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# Exclude everything from the Docker build context:
2+
*
3+
4+
# Except for this content:
5+
!bin/
6+
!etc/
7+
!testssl.sh
8+
9+
# But additionally exclude this nested content:
110
bin/openssl.Darwin.*
211
bin/openssl.FreeBSD.*

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ RUN apk update && \
1010
USER testssl
1111
WORKDIR /home/testssl/
1212

13-
COPY --chown=testssl:testssl etc/. /home/testssl/etc/
14-
COPY --chown=testssl:testssl bin/. /home/testssl/bin/
15-
COPY --chown=testssl:testssl testssl.sh /home/testssl/
13+
# Copy over build context (after filtered by .dockerignore): bin/ etc/ testssl.sh
14+
COPY --chown=testssl:testssl . /home/testssl/
1615

1716
ENTRYPOINT ["testssl.sh"]
1817

0 commit comments

Comments
 (0)