get.porter.sh/porter@v1.3.0/build/images/client/Dockerfile (about)

     1  FROM alpine:3 as builder
     2  WORKDIR /app/.porter
     3  
     4  RUN mkdir runtimes && \
     5      mkdir -p mixins/exec/runtimes
     6  
     7  # Only install porter and the exec mixin, everything else
     8  # must be mounted into the container
     9  COPY bin/dev/porter-linux-amd64 porter
    10  COPY bin/mixins/exec/dev/exec-linux-amd64 mixins/exec/exec
    11  RUN ln -s /app/.porter/porter runtimes/porter-runtime && \
    12      ln -s /app/.porter/mixins/exec/exec mixins/exec/runtimes/exec-runtime
    13  
    14  # Copy the porter installation into a distroless container
    15  # Explicitly not using the nonroot tag because we don't want the user to exist so it is placed in the root group
    16  # This allows us to run with a random UID, and access a mounted docker socket (which is only accessible via the root group)
    17  FROM gcr.io/distroless/static
    18  WORKDIR /app
    19  COPY --from=builder --chown=65532:0 --chmod=770 /app/.porter /app/.porter
    20  ENV PATH "$PATH:/app/.porter"
    21  
    22  # Run as a nonroot user
    23  USER 65532
    24  ENTRYPOINT ["/app/.porter/porter"]