![]() The COPY -from=0 line copies just the built artifact from the previous stage into this new stage. How does it work? The second FROM instruction starts a new build stage with the alpine:latest image as its base. You don’t need to create any intermediate images and you don’t need to extract any artifacts to your local system at all. ![]() The end result is the same tiny production image as before, with a significant reduction in complexity. Then build the image normally: docker build -t alexellis2/href-counter:latest ĬOPY -from=0 /go/src//alexellis/href-counter/app. RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app. You can, with the multi-stage builds feature introduced in Docker 1.17 ![]() Is there a way to combine Docker images into 1 container?
0 Comments
Leave a Reply. |