distroless dockerfile result in more than 1 images

194 views Asked by At

I just create a dockerfile for postgres using multi-step distroless image. I try to learn distroless because of security and size of the image. here's my dockerfile:

### First Stage ###
# Base Image
FROM postgres:13-alpine as build
WORKDIR /usr/src/app/postgres

### Second Stage ###
FROM gcr.io/distroless/base-debian10
COPY --from=build /usr/src/app/postgres /usr/src/app/postgres
WORKDIR /usr/src/app/postgres

# Change user to non-root
USER 1002

# Run POSTGRES
CMD ["/postgres"]

After building the image the end result is 4 images instead of 1 like image below enter image description here

I'm new to docker and as far as I know 1 dockerfile should result in 1 images, can anyone explain why this is happened?

0

There are 0 answers