-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into qdm12-1893
- Loading branch information
Showing
10 changed files
with
57 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/.git | ||
/.githooks | ||
/.github | ||
/docs | ||
/.deepsource.toml | ||
/.dockerignore | ||
/.gitattributes | ||
/.gitignore | ||
/.releaserc | ||
/.codecov.yml | ||
/docker-compose.yml | ||
/Dockerfile | ||
/Dockerfile.staging | ||
/prometheus.yml | ||
/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,56 @@ | ||
FROM ubuntu:18.04 as builder | ||
ARG DEBIAN_VERSION=bullseye-slim | ||
ARG GO_VERSION=1.15-buster | ||
|
||
FROM golang:${GO_VERSION} AS builder | ||
|
||
# Install GCC | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
gcc \ | ||
cmake \ | ||
wget \ | ||
curl \ | ||
npm | ||
wget | ||
|
||
# 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 | ||
RUN wget -qO- https://deb.nodesource.com/setup_14.x | bash - && \ | ||
apt-get install -y nodejs | ||
|
||
# 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 | ||
RUN wget -O /usr/local/bin/subkey https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0 && \ | ||
chmod +x /usr/local/bin/subkey | ||
|
||
# Prepare structure and change dir | ||
RUN mkdir -p $GOPATH/src/github.com/ChainSafe/gossamer | ||
WORKDIR $GOPATH/src/github.com/ChainSafe/gossamer | ||
# 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 | ||
|
||
# Add go mod lock files and gossamer default config | ||
COPY go.mod . | ||
COPY go.sum . | ||
WORKDIR /go/src/github.com/ChainSafe/gossamer | ||
|
||
# Get go mods | ||
# Go dependencies | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Copy gossamer sources | ||
COPY . $GOPATH/src/github.com/ChainSafe/gossamer | ||
# Prepare libwasmer.so for COPY | ||
RUN cp /go/pkg/mod/github.com/wasmerio/go-ext-wasm@*/wasmer/libwasmer.so libwasmer.so | ||
|
||
# Install js dependencies for polkadot.js tests | ||
RUN cd $GOPATH/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test && npm install | ||
# Copy gossamer sources | ||
COPY . . | ||
|
||
# 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 | ||
# Final stage based on Debian | ||
FROM debian:${DEBIAN_VERSION} | ||
|
||
WORKDIR /gossamer | ||
|
||
# Give permissions | ||
RUN chmod +x $GOPATH/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh | ||
# 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 gossamer command and port | ||
ENTRYPOINT ["/gocode/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh"] | ||
CMD ["/usr/local/gossamer"] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters