2018-01-17 21:40:14 +00:00
|
|
|
# Build status-go in a Go builder container
|
2024-06-11 11:36:20 +00:00
|
|
|
FROM golang:1.21-alpine3.18 as builder
|
2024-05-17 13:51:51 +00:00
|
|
|
|
2024-09-24 12:22:17 +00:00
|
|
|
# Set environment variables to use Clang
|
|
|
|
ENV CC=clang
|
|
|
|
ENV CXX=clang++
|
2017-05-12 12:04:32 +00:00
|
|
|
|
2024-11-03 00:47:15 +00:00
|
|
|
RUN apk add --no-cache git bash make llvm clang musl-dev linux-headers protobuf-dev~3.21
|
2018-08-24 10:25:07 +00:00
|
|
|
|
2018-01-30 11:51:48 +00:00
|
|
|
ARG build_tags
|
2018-06-08 09:20:30 +00:00
|
|
|
ARG build_flags
|
2023-04-26 18:17:16 +00:00
|
|
|
ARG build_target=statusgo
|
2018-01-30 11:51:48 +00:00
|
|
|
|
2018-01-03 18:50:19 +00:00
|
|
|
RUN mkdir -p /go/src/github.com/status-im/status-go
|
2020-03-10 12:40:35 +00:00
|
|
|
WORKDIR /go/src/github.com/status-im/status-go
|
|
|
|
ADD . .
|
2024-10-03 19:59:44 +00:00
|
|
|
|
|
|
|
RUN go install go.uber.org/mock/mockgen@v0.4.0
|
|
|
|
RUN go install github.com/kevinburke/go-bindata/v4/...@v4.0.2
|
|
|
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.1
|
2023-11-23 14:55:13 +00:00
|
|
|
RUN make $build_target BUILD_TAGS="$build_tags" BUILD_FLAGS="$build_flags" SHELL="/bin/sh"
|
2017-05-12 12:04:32 +00:00
|
|
|
|
2018-01-03 18:50:19 +00:00
|
|
|
# Copy the binary to the second image
|
2024-05-17 13:51:51 +00:00
|
|
|
FROM alpine:3.18
|
2018-01-03 18:50:19 +00:00
|
|
|
|
2023-04-26 18:17:16 +00:00
|
|
|
ARG build_target=statusgo
|
|
|
|
|
2018-08-24 10:25:07 +00:00
|
|
|
LABEL maintainer="support@status.im"
|
2018-07-10 09:29:40 +00:00
|
|
|
LABEL source="https://github.com/status-im/status-go"
|
|
|
|
LABEL description="status-go is an underlying part of Status - a browser, messenger, and gateway to a decentralized world."
|
|
|
|
|
2024-07-04 10:50:15 +00:00
|
|
|
RUN apk add --no-cache ca-certificates bash libgcc libstdc++ curl
|
2018-08-24 10:25:07 +00:00
|
|
|
RUN mkdir -p /static/keys
|
2024-06-11 11:36:20 +00:00
|
|
|
RUN mkdir -p /static/configs
|
2018-01-30 11:51:48 +00:00
|
|
|
|
2023-04-26 18:17:16 +00:00
|
|
|
COPY --from=builder /go/src/github.com/status-im/status-go/build/bin/$build_target /usr/local/bin/
|
2018-01-03 18:50:19 +00:00
|
|
|
COPY --from=builder /go/src/github.com/status-im/status-go/static/keys/* /static/keys/
|
2024-10-03 13:51:51 +00:00
|
|
|
COPY --from=builder /go/src/github.com/status-im/status-go/tests-functional/config.json /static/configs/
|
2018-01-03 18:50:19 +00:00
|
|
|
|
2023-04-26 18:17:16 +00:00
|
|
|
RUN ln -s /usr/local/bin/$build_target /usr/local/bin/entrypoint
|
|
|
|
|
2018-01-03 18:50:19 +00:00
|
|
|
# 30304 is used for Discovery v5
|
|
|
|
EXPOSE 8080 8545 30303 30303/udp 30304/udp
|
2018-07-10 09:29:40 +00:00
|
|
|
|
2023-04-26 18:17:16 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
2018-07-11 11:45:27 +00:00
|
|
|
CMD ["--help"]
|