mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 06:12:55 +00:00
Jakub Sokołowski
8191f24ef3
Otherwise it fails with: ``` build github.com/status-im/status-go/cmd/statusd: cannot load github.com/lucas-clemente/quic-go/internal/qtls: no Go source files ``` We also add missing `g++` compiler for `go-libutp` to fix: ``` go build github.com/anacrolix/go-libutp: g++: exec: "g++": executable file not found in $PATH ``` As well as install `libgcc` and `libstdc++` to avoids failures like this: ``` Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/bin/statusd) Error loading shared library libgcc_s.so.1: No such file or directory (needed by /usr/local/bin/statusd) Error relocating /usr/local/bin/statusd: _Znwm: symbol not found Error relocating /usr/local/bin/statusd: _ZdlPvm: symbol not found Error relocating /usr/local/bin/statusd: _Unwind_Resume: symbol not found Error relocating /usr/local/bin/statusd: __gxx_personality_v0: symbol not found ``` Signed-off-by: Jakub Sokołowski <jakub@status.im>
32 lines
1023 B
Docker
32 lines
1023 B
Docker
# Build status-go in a Go builder container
|
|
FROM golang:1.18-alpine as builder
|
|
|
|
RUN apk add --no-cache make gcc g++ musl-dev linux-headers
|
|
|
|
ARG build_tags
|
|
ARG build_flags
|
|
|
|
RUN mkdir -p /go/src/github.com/status-im/status-go
|
|
WORKDIR /go/src/github.com/status-im/status-go
|
|
ADD . .
|
|
RUN make statusgo BUILD_TAGS="$build_tags" BUILD_FLAGS="$build_flags"
|
|
|
|
# Copy the binary to the second image
|
|
FROM alpine:latest
|
|
|
|
LABEL maintainer="support@status.im"
|
|
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."
|
|
|
|
RUN apk add --no-cache ca-certificates bash libgcc libstdc++
|
|
RUN mkdir -p /static/keys
|
|
|
|
COPY --from=builder /go/src/github.com/status-im/status-go/build/bin/statusd /usr/local/bin/
|
|
COPY --from=builder /go/src/github.com/status-im/status-go/static/keys/* /static/keys/
|
|
|
|
# 30304 is used for Discovery v5
|
|
EXPOSE 8080 8545 30303 30303/udp 30304/udp
|
|
|
|
ENTRYPOINT ["/usr/local/bin/statusd"]
|
|
CMD ["--help"]
|