Skip to content

Commit

Permalink
fix: ensure test layer is in the build DAG
Browse files Browse the repository at this point in the history
Some builders will exclude layers that do not contribute to the final
target layer, meaning the `ship` layer for these templates. This means
that the `test` layer is often optimized away by modern builders.

We add the `test` layer as a dependency of the `ship` layer to ensure it
is always run.

Signed-off-by: Lucas Roesler <[email protected]>
  • Loading branch information
LucasRoesler committed Feb 6, 2024
1 parent 448f54d commit a091502
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion template/python3-flask-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ARG TEST_ENABLED=true
RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND"


FROM build as ship
FROM test as ship
WORKDIR /home/app/

#configure WSGI server and healthcheck
Expand Down
2 changes: 1 addition & 1 deletion template/python3-flask/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ARG TEST_COMMAND=tox
ARG TEST_ENABLED=true
RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND"

FROM build as ship
FROM test as ship
WORKDIR /home/app/

#configure WSGI server and healthcheck
Expand Down
2 changes: 1 addition & 1 deletion template/python3-http-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ARG TEST_ENABLED=true
RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND"


FROM build as ship
FROM test as ship
WORKDIR /home/app/

USER app
Expand Down
2 changes: 1 addition & 1 deletion template/python3-http/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ARG TEST_COMMAND=tox
ARG TEST_ENABLED=true
RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND"

FROM build as ship
FROM test as ship
WORKDIR /home/app/

# configure WSGI server and healthcheck
Expand Down

0 comments on commit a091502

Please sign in to comment.