github.com/vmware/govmomi@v0.51.0/Dockerfile.vcsim (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 to 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  FROM scratch
    26  
    27  USER appuser:appuser
    28  
    29  COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
    30  
    31  COPY --from=build /etc/passwd /etc/passwd
    32  COPY --from=build /etc/group /etc/group
    33  
    34  COPY --chown=appuser --from=build /temporary-tmp-directory /tmp
    35  
    36  EXPOSE 8989
    37  
    38  COPY vcsim /vcsim
    39  
    40  ENTRYPOINT [ "/vcsim" ]
    41  
    42  CMD ["-l", "0.0.0.0:8989"]