forked from ChainSafe/gossamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (49 loc) · 1.71 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
62
63
64
FROM ubuntu:18.04 as builder
# Install GCC
RUN apt-get update && \
apt-get install -y \
gcc \
cmake \
wget \
curl \
npm
# Install node source for polkadotjs tests
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# Install nodejs for polkadotjs tests
RUN apt-get update && \
apt-get install -y \
nodejs
# Install Go
RUN wget https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
# Install subkey
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
RUN mv /usr/local/bin/subkey-v2.0.0 /usr/local/bin/subkey
RUN chmod +x /usr/local/bin/subkey
# Configure go env vars
ENV GO111MODULE=on
ENV GOPATH=/gocode
ENV GOROOT=/usr/local/go
ENV PATH=$PATH:$GOPATH/bin:$GOROOT/bin
# Prepare structure and change dir
RUN mkdir -p $GOPATH/src/github.com/ChainSafe/gossamer
WORKDIR $GOPATH/src/github.com/ChainSafe/gossamer
# Add go mod lock files and gossamer default config
COPY go.mod .
COPY go.sum .
# Get go mods
RUN go mod download
# Copy gossamer sources
COPY . $GOPATH/src/github.com/ChainSafe/gossamer
# Install js dependencies for polkadot.js tests
RUN cd $GOPATH/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test && npm install
# Build
RUN GOBIN=$GOPATH/src/github.com/ChainSafe/gossamer/bin go run scripts/ci.go install
# Create symlink
RUN ln -s $GOPATH/src/github.com/ChainSafe/gossamer/bin/gossamer /usr/local/gossamer
# Give permissions
RUN chmod +x $GOPATH/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh
# Expose gossamer command and port
ENTRYPOINT ["/gocode/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh"]
CMD ["/usr/local/gossamer"]
EXPOSE 7001 8546 8540