-
Notifications
You must be signed in to change notification settings - Fork 126
/
Dockerfile
47 lines (34 loc) · 1011 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
ARG DEBIAN_VERSION=bullseye-slim
ARG GO_VERSION=1.23.2-bullseye
FROM golang:${GO_VERSION} AS builder
RUN apt-get update && \
apt-get install -y \
gcc \
cmake \
wget
# Install node source for polkadotjs tests
RUN wget -qO- https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Install subkey
RUN wget -O /usr/local/bin/subkey https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0 && \
chmod +x /usr/local/bin/subkey
WORKDIR /go/src/github.com/ChainSafe/gossamer
# Go dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy gossamer sources
COPY . .
# Build
ARG GO_BUILD_FLAGS
RUN go build \
-trimpath \
-o ./bin/gossamer \
${GO_BUILD_FLAGS} \
./cmd/gossamer
# Final stage based on Debian
FROM debian:${DEBIAN_VERSION}
WORKDIR /gossamer
EXPOSE 7001 8546 8540
ENTRYPOINT [ "/gossamer/bin/gossamer" ]
COPY chain /gossamer/chain
COPY --from=builder /go/src/github.com/ChainSafe/gossamer/bin/gossamer /gossamer/bin/gossamer