Skip to content

Instantly share code, notes, and snippets.

@jjangga0214
Last active December 23, 2019 04:57
Show Gist options
  • Save jjangga0214/03abe8c4f420ecf04934549e61bd0597 to your computer and use it in GitHub Desktop.
Save jjangga0214/03abe8c4f420ecf04934549e61bd0597 to your computer and use it in GitHub Desktop.

Dockerfiles

multi stages build with busybox

FROM golang:1.11-alpine AS build
WORKDIR /src/
COPY main.go go.* /src/
RUN CGO_ENABLED=0 go build -o /bin/demo

FROM scratch
COPY --from=build /bin/demo /bin/demo
COPY --from=busybox:1.28 /bin/busybox /bin/busybox
ENTRYPOINT ["/bin/demo"]
kubectl exec -it <pod> /bin/busybox sh
  • ref: Cloud Native Devops with Kubernetes, p.125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment