github.com/docker/cnab-to-oci@v0.3.0-beta4/Dockerfile (about) 1 ARG ALPINE_VERSION=3.10 2 ARG GO_VERSION=1.13.0 3 4 # build image 5 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as build 6 7 ARG DOCKERCLI_VERSION=19.03.1 8 ARG DOCKERCLI_CHANNEL=stable 9 10 ARG BUILDTIME 11 ARG COMMIT 12 ARG TAG 13 ARG GOPROXY 14 15 RUN apk add --no-cache \ 16 bash \ 17 make \ 18 git \ 19 curl \ 20 util-linux \ 21 coreutils \ 22 build-base 23 24 # Fetch docker cli to run a registry container for e2e tests 25 RUN curl -Ls https://download.docker.com/linux/static/${DOCKERCLI_CHANNEL}/x86_64/docker-${DOCKERCLI_VERSION}.tgz | tar -xz 26 27 WORKDIR /go/src/github.com/docker/cnab-to-oci 28 COPY . . 29 RUN make BUILDTIME=$BUILDTIME COMMIT=$COMMIT TAG=$TAG bin/cnab-to-oci &&\ 30 make BUILDTIME=$BUILDTIME COMMIT=$COMMIT TAG=$TAG build-e2e-test 31 32 # e2e image 33 FROM alpine:${ALPINE_VERSION} as e2e 34 35 # copy all the elements needed for e2e tests from build image 36 COPY --from=build /go/docker/docker /usr/bin/docker 37 COPY --from=build /go/src/github.com/docker/cnab-to-oci/bin/cnab-to-oci /usr/bin/cnab-to-oci 38 COPY --from=build /go/src/github.com/docker/cnab-to-oci/e2e /e2e 39 COPY --from=build /go/src/github.com/docker/cnab-to-oci/e2e.test /e2e/e2e.test 40 41 # Run end-to-end tests 42 CMD ["e2e/run.sh"]