github.com/vmware/govmomi@v0.51.0/Dockerfile.govc (about) 1 # © Broadcom. All Rights Reserved. 2 # The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 # SPDX-License-Identifier: Apache-2.0 4 5 # --- Builder Stage --- 6 # Uses the official Go Docker image for the build. 7 8 ARG GO_VERSION 9 FROM golang:${GO_VERSION} AS build 10 WORKDIR /go/src/app 11 12 ENV USER=appuser 13 ENV UID=10001 14 RUN adduser \ 15 --disabled-password \ 16 --gecos "" \ 17 --shell "/sbin/nologin" \ 18 --no-create-home \ 19 --uid "${UID}" \ 20 "${USER}" 21 22 RUN mkdir /temporary-tmp-directory && chmod 777 /temporary-tmp-directory 23 24 # --- Final Stage --- 25 26 FROM scratch 27 28 COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 29 30 COPY --from=build /etc/passwd /etc/passwd 31 COPY --from=build /etc/group /etc/group 32 33 COPY --chown=appuser --from=build /temporary-tmp-directory /tmp 34 35 COPY govc /govc 36 37 USER appuser:appuser 38 39 ENV GOVMOMI_HOME=/tmp 40 41 CMD ["/govc"]