-
Notifications
You must be signed in to change notification settings - Fork 952
Expand file tree
/
Copy pathDockerfile.vcsim
More file actions
42 lines (29 loc) · 907 Bytes
/
Dockerfile.vcsim
File metadata and controls
42 lines (29 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# © Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
# SPDX-License-Identifier: Apache-2.0
# --- Builder Stage ---
# Uses the official Go Docker image to for the build.
ARG GO_VERSION
FROM golang:${GO_VERSION} AS build
WORKDIR /go/src/app
ENV USER=appuser
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
RUN mkdir /temporary-tmp-directory && chmod 777 /temporary-tmp-directory
# --- Final Stage ---
FROM scratch
USER appuser:appuser
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /etc/group /etc/group
COPY --chown=appuser --from=build /temporary-tmp-directory /tmp
EXPOSE 8989
COPY vcsim /vcsim
ENTRYPOINT [ "/vcsim" ]
CMD ["-l", "0.0.0.0:8989"]