-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from xmidt-org/local_sat2
fix .release config and add local build dockerfile
- Loading branch information
Showing
4 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters