Skip to content

Commit

Permalink
Adopt multi-stage build to eliminate test files from final resource
Browse files Browse the repository at this point in the history
  • Loading branch information
bgandon committed Dec 4, 2024
1 parent 4ab6576 commit 4c444e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LABEL maintainer="Gstack <https://github.com/gstackio>" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0"

# Notice: the 'gettext-dev' package provides the required 'envsubst' binary
RUN apk add --no-cache curl bash jq gettext-dev

COPY check /opt/resource/check
Expand All @@ -21,6 +22,14 @@ COPY out /opt/resource/out

RUN chmod +x /opt/resource/out /opt/resource/in /opt/resource/check



FROM resource AS tests

ADD test/ /opt/resource-tests/
RUN /opt/resource-tests/all.sh \
&& rm -rf /tmp/*



FROM resource

0 comments on commit 4c444e2

Please sign in to comment.