forked from ChainSafe/gossamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (45 loc) · 1.53 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ARG DEBIAN_VERSION=bullseye-slim
ARG GO_VERSION=1.17-buster
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
# Polkadot JS dependencies
WORKDIR /go/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test
COPY tests/polkadotjs_test/package.json tests/polkadotjs_test/package-lock.json ./
RUN npm install
WORKDIR /go/src/github.com/ChainSafe/gossamer
# Go dependencies
COPY go.mod go.sum ./
RUN go mod download
# Prepare libwasmer.so for COPY
RUN cp /go/pkg/mod/github.com/wasmerio/go-ext-wasm@*/wasmer/libwasmer.so libwasmer.so
# 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
# Install libwasmer.so
ENV LD_LIBRARY_PATH=/lib:/usr/lib
COPY --from=builder /go/src/github.com/ChainSafe/gossamer/libwasmer.so /lib/libwasmer.so
EXPOSE 7001 8546 8540
ENTRYPOINT ["/gossamer/docker-entrypoint.sh"]
CMD ["/gossamer/bin/gossamer"]
COPY chain /gossamer/chain
COPY scripts/docker-entrypoint.sh /gossamer/docker-entrypoint.sh
COPY --from=builder /go/src/github.com/ChainSafe/gossamer/bin/gossamer /gossamer/bin/gossamer