HUB
Sign inSign up
http-server logo

yiorgos/http-server

By yiorgos

•Updated over 2 years ago

Testing a multistage build

Image
0

343

yiorgos/http-server repository overview

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"]
Tag summary
Recent tags
Content type
Image
Digest
sha256:97e1de5cc…
Size
3.8 MB
Last updated
over 2 years ago
docker pull yiorgos/http-server:latest