Testing multistage builds, using this example:
# This is an example for a multistage build
# We build a simple http server using the golang docker image
# but we deploy it using busybox
FROM golang AS server-build
WORKDIR /usr/src
COPY http-servers.go .
# https://golang.org/cmd/cgo/
RUN CGO_ENABLED=0 go build http-servers.go
FROM busybox
WORKDIR /usr/app
COPY --from=server-build /usr/src/http-servers .
EXPOSE 8090
CMD ["./http-servers"]
# FROM scratch
# COPY --from=server-build /usr/src/http-servers .
# EXPOSE 8090
# CMD ["/http-servers"]
Content type
Image
Digest
sha256:97e1de5cc…
Size
3.8 MB
Last updated
about 2 years ago
docker pull yiorgos/http-server