-
Notifications
You must be signed in to change notification settings - Fork 65
/
Dockerfile
32 lines (23 loc) · 963 Bytes
/
Dockerfile
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
FROM --platform=$BUILDPLATFORM golang:1.21-bullseye AS build-env
WORKDIR /src/app/fairyring
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Dockerfile Cross-Compilation Guide
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide
ARG TARGETOS TARGETARCH
# install simapp, remove packages
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build
# Final image, without build artifacts. `/base` already contains openssl, glibc and all required libs to start an app
FROM gcr.io/distroless/base
FROM ubuntu:20.04
EXPOSE 26656 26657 1317 9090
# Run simd by default, omit entrypoint to ease using container with simcli
#CMD ["fairyringd"]
#STOPSIGNAL SIGTERM
WORKDIR /root
COPY setup.scripts/docker_setup.sh /usr/bin/setup.sh
RUN ["chmod", "+x", "/usr/bin/setup.sh"]
# Copy over binaries from the build-env
COPY --from=build-env /src/app/fairyring/build/fairyringd /usr/bin/fairyringd
CMD ["/usr/bin/fairyringd", "version"]