post image January 6, 2022 | 1 min Read

Docker layers

cat  Dockerfile 
FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install golang-go -y
COPY app.go .
RUN CGO_ENABLED=0 go build app.go


FROM alpine:3.12.1
RUN chmod a-w /etc && \
  addgroup -S appgroup && adduser -S appuser -G appgroup -h /home/appuser && \
  rm -rf /bin/*
COPY --from=0 /app /home/appuser
USER appuser
CMD ["/home/appuser/app"]

author image

Jan Toth

I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …

comments powered by Disqus