/
Dockerfile.local
61 lines (43 loc) · 1.65 KB
/
Dockerfile.local
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
## SPDX-FileCopyrightText: 2022 Comcast Cable Communications Management, LLC
## SPDX-License-Identifier: Apache-2.0
FROM docker.io/library/golang:1.19-alpine as builder
ARG arm64
COPY . /src
WORKDIR /src
RUN apk add --no-cache --no-progress \
ca-certificates \
make \
curl
# Download spruce here to eliminate the need for curl in the final image
ENV spruce_url_amd64=https://github.com/geofffranks/spruce/releases/download/v1.29.0/spruce-linux-amd64
ENV spruce_url_arm64=https://github.com/geofffranks/spruce/releases/download/v1.30.2/spruce-linux-arm64
RUN [ ${arm64}=true ] && (curl -L -o /go/bin/spruce ${spruce_url_arm64}) || (curl -L -o /go/bin/spruce ${spruce_url_amd64})
RUN mkdir -p /go/bin && \
chmod +x /go/bin/spruce
RUN make build
##########################
# Build the final image.
##########################
FROM alpine:latest
# Copy over the standard things you'd expect.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/tr1d1um /
COPY .release/docker/entrypoint.sh /
# Copy over spruce and the spruce template file used to make the actual configuration file.
COPY .release/docker/tr1d1um_spruce.yaml /tmp/tr1d1um_spruce.yaml
COPY --from=builder /go/bin/spruce /bin/
# Include compliance details about the container and what it contains.
COPY Dockerfile /
COPY NOTICE /
COPY LICENSE /
# Make the location for the configuration file that will be used.
RUN mkdir /etc/tr1d1um/ \
&& touch /etc/tr1d1um/tr1d1um.yaml \
&& chmod 666 /etc/tr1d1um/tr1d1um.yaml
USER nobody
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 6100
EXPOSE 6101
EXPOSE 6102
EXPOSE 6103
CMD ["/tr1d1um"]