Last active
February 20, 2020 06:09
-
-
Save Syerram/9a2ec3dc8c79feadf27ed95950f0ba80 to your computer and use it in GitHub Desktop.
Revisions
-
Syerram revised this gist
Feb 20, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ FROM $BASE_IMAGE # Labels can be scoped to a stage ARG LABEL_2 ARG LABEL_3 # copy the artifact from stage 1 COPY --from=builder hello.txt hello.txt RUN cat hello.txt RUN echo "in dev" -
Syerram revised this gist
Feb 20, 2020 . 2 changed files with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,15 @@ # accept base image versions or an entire base image for all stages ARG BASE_IMAGE_VERSION ARG BASE_IMAGE FROM busybox:$BASE_IMAGE_VERSION as builder ARG LABEL_1 COPY hello.txt hello.txt RUN echo "in builder" RUN echo $LABEL_1 LABEL org.opencontainers.image.revision=$LABEL_1 FROM $BASE_IMAGE # Labels can be scoped to a stage ARG LABEL_2 ARG LABEL_3 COPY --from=builder hello.txt hello.txt This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ docker build --build-arg BASE_IMAGE_VERSION=1.31.1 \ --build-arg LABEL_1=1.11 \ --build-arg BASE_IMAGE=alpine:3.8.5 \ --build-arg LABEL_2=2.22 \ --build-arg LABEL_3=3.33 -t multi-stage-image:v1 . # inspect the image and see the labels, notice it pulls alpine version 3.8.5 -
Syerram revised this gist
Feb 20, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ # accept base image versions for all stage ARG BASE_IMAGE_VERSION_1 ARG BASE_IMAGE_VERSION_2 # this can be the whole base image # e.g. FROM $BASE_IMAGE:$BASE_IMAGE_VERSION FROM busybox:$BASE_IMAGE_VERSION_1 as builder ARG LABEL_1 COPY hello.txt hello.txt @@ -8,6 +11,7 @@ RUN echo $LABEL_1 LABEL org.opencontainers.image.revision=$LABEL_1 FROM alpine:$BASE_IMAGE_VERSION_2 # Labels that are scope to a stage come after FROM ARG LABEL_2 ARG LABEL_3 COPY --from=builder hello.txt hello.txt -
Syerram revised this gist
Feb 20, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ ola! -
Syerram revised this gist
Feb 20, 2020 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,6 @@ docker build --build-arg BASE_IMAGE_VERSION_1=1.31.1 \ --build-arg LABEL_1=1.11 \ --build-arg BASE_IMAGE_VERSION_2=3.8.5 \ --build-arg LABEL_2=2.22 \ --build-arg LABEL_3=3.33 -t ms-test:v3 . -
Syerram created this gist
Feb 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ ARG BASE_IMAGE_VERSION_1 ARG BASE_IMAGE_VERSION_2 FROM busybox:$BASE_IMAGE_VERSION_1 as builder ARG LABEL_1 COPY hello.txt hello.txt RUN echo "in builder" RUN echo $LABEL_1 LABEL org.opencontainers.image.revision=$LABEL_1 FROM alpine:$BASE_IMAGE_VERSION_2 ARG LABEL_2 ARG LABEL_3 COPY --from=builder hello.txt hello.txt RUN cat hello.txt RUN echo "in dev" RUN echo $LABEL_3 LABEL org.opencontainers.image.source=$LABEL_2 LABEL org.opencontainers.image.vendor=$LABEL_3 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ docker build --build-arg BASE_IMAGE_VERSION_1=1.31.1 --build-arg LABEL_1=1.11 --build-arg BASE_IMAGE_VERSION_2=3.8.5 --build-arg LABEL_2=2.22 --build-arg LABEL_3=3.33 -t ms-test:v3 .