From 6a0d35a63f5dbe70886f6206696011cd16d69f6e Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:06:32 +0700 Subject: [PATCH 1/6] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..d868675 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag faddat/bnc From 9d61039ad5963f2643951962930dc5b377f33e82 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:10:45 +0700 Subject: [PATCH 2/6] Update Dockerfile --- docker/Dockerfile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 35a67ee..98e53c1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,15 @@ # UPDATE ME when new version is out !!!! -ARG BVER_TESTNET=0.7.1 -ARG CLIVER_TESTNET=0.7.0 -ARG BVER_PROD=0.7.2-hf.1 -ARG CLIVER_PROD=0.7.2 +ARG BVER_TESTNET=0.8.2 +ARG CLIVER_TESTNET=0.8.2 +ARG BVER_PROD=0.8.2 +ARG CLIVER_PROD=0.8.2 FROM ubuntu:18.04 as builder # Dockerfile for running Binance node from binary packages under docker # https://docs.binance.org/fullnode.html#run-full-node-to-join-binance-chain # MIT license -LABEL Maintainer = "Evgeny Varnavskiy " +LABEL Maintainer="Evgeny Varnavskiy " +LABEL Maintainer="Jacob Gadikian " LABEL Description="Docker image for Binance full and light nodes" LABEL License="MIT License" @@ -59,14 +60,7 @@ COPY --from=builder /node-binary/${NODETYPE}/testnet/${BVER_TESTNET}/config/* /n COPY --from=builder /node-binary/${NODETYPE}/prod/${BVER_PROD}/config/* /node-binary/fullnode/prod/${BVER}/config/ COPY --from=builder /node-binary/docker/bin/*.sh /usr/local/bin/ -RUN set -ex \ -&& chmod +x /usr/local/bin/*.sh \ -&& mkdir -p "$BNCHOME" \ -&& groupadd --gid "$HOST_USER_GID" bnbchaind \ -&& useradd --uid "$HOST_USER_UID" --gid "$HOST_USER_GID" --shell /bin/bash --no-create-home bnbchaind \ -&& chown -R bnbchaind:bnbchaind "$BNCHOME" - -VOLUME ${BNCHOME} +VOLUME /opt/bnbchaind # RPC service listen on port 27147 and P2P service listens on port 27146 by default. # Prometheus is enabled on port 26660 by default, and the endpoint is /metrics. From 91369681a779cc8254764d124722deea6bcbe453 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:11:19 +0700 Subject: [PATCH 3/6] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d868675..b23f163 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: docker build . --file Dockerfile --tag faddat/bnc + run: docker build . --file docker/Dockerfile --tag faddat/bnc From c94ae4041cc86589c4dee5888e79d7156235d723 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:25:07 +0700 Subject: [PATCH 4/6] Update Dockerfile --- docker/Dockerfile | 62 +++++++++-------------------------------------- 1 file changed, 11 insertions(+), 51 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 98e53c1..4e65a1b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,4 @@ -# UPDATE ME when new version is out !!!! -ARG BVER_TESTNET=0.8.2 -ARG CLIVER_TESTNET=0.8.2 -ARG BVER_PROD=0.8.2 -ARG CLIVER_PROD=0.8.2 -FROM ubuntu:18.04 as builder +FROM ubuntu # Dockerfile for running Binance node from binary packages under docker # https://docs.binance.org/fullnode.html#run-full-node-to-join-binance-chain @@ -13,53 +8,18 @@ LABEL Maintainer="Jacob Gadikian " LABEL Description="Docker image for Binance full and light nodes" LABEL License="MIT License" -ARG DEBIAN_FRONTEND=noninteractive - -ARG BVER_TESTNET -ARG CLIVER_TESTNET -ARG BVER_PROD -ARG CLIVER_PROD -ARG NODETYPE=fullnode -#ARG NODETYPE=lightnode - -RUN apt-get update && apt-get install -y --no-install-recommends upx ca-certificates wget git git-lfs binutils -RUN git lfs clone --depth 1 https://github.com/binance-chain/node-binary.git - -# RUN upx /node-binary/cli/testnet/${CLIVER}/linux/tbnbcli \ -# && upx /node-binary/cli/prod/${CLIVER}/linux/bnbcli \ -# && upx /node-binary/${NODETYPE}/testnet/${BVER}/linux/bnbchaind \ -# && upx /node-binary/${NODETYPE}/prod/${BVER}/linux/bnbchaind - -# Final stage -FROM ubuntu:18.04 - -ARG HOST_USER_UID=1000 -ARG HOST_USER_GID=1000 - -ARG BVER_TESTNET -ARG CLIVER_TESTNET -ARG BVER_PROD -ARG CLIVER_PROD -ENV BVER_TESTNET=$BVER_TESTNET -ENV CLIVER_TESTNET=$CLIVER_TESTNET -ENV BVER_PROD=$BVER_PROD -ENV CLIVER_PROD=$CLIVER_PROD - -ARG NODETYPE=fullnode -#ARG NODETYPE=lightnode -ENV BNET=testnet -#ENV BNET=prod ENV BNCHOME=/opt/bnbchaind +ARG DEBIAN_FRONTEND=noninteractive -COPY --from=builder /node-binary/cli/testnet/${CLIVER_TESTNET}/linux/tbnbcli /node-binary/cli/testnet/${BVER}/linux/ -COPY --from=builder /node-binary/cli/prod/${CLIVER_PROD}/linux/bnbcli /node-binary/cli/prod/${BVER}/linux/ -COPY --from=builder /node-binary/${NODETYPE}/testnet/${BVER_TESTNET}/linux/bnbchaind /node-binary/fullnode/testnet/${BVER}/linux/ -COPY --from=builder /node-binary/${NODETYPE}/prod/${BVER_PROD}/linux/bnbchaind /node-binary/fullnode/prod/${BVER}/linux/ -COPY --from=builder /node-binary/${NODETYPE}/testnet/${BVER_TESTNET}/config/* /node-binary/fullnode/testnet/${BVER}/config/ -COPY --from=builder /node-binary/${NODETYPE}/prod/${BVER_PROD}/config/* /node-binary/fullnode/prod/${BVER}/config/ -COPY --from=builder /node-binary/docker/bin/*.sh /usr/local/bin/ - +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget binutils +RUN wget -O /usr/bin/bnbchaind https://github.com/binance-chain/node-binary/blob/master/fullnode/prod/0.8.2/linux/bnbchaind +RUN mkdir -p /opt/bnbchaind/config && \ + wget -O /opt/bnbchaind/config/app.toml https://github.com/binance-chain/node-binary/raw/master/fullnode/prod/0.8.2/config/app.toml && \ + wget -O /opt/bnbchaind/config/config.toml https://github.com/binance-chain/node-binary/raw/master/fullnode/prod/0.8.2/config/config.toml && \ + wget -O /opt/bnbchaind/config/genesis.json https://github.com/binance-chain/node-binary/raw/master/fullnode/prod/0.8.2/config/genesis.json + + VOLUME /opt/bnbchaind # RPC service listen on port 27147 and P2P service listens on port 27146 by default. @@ -67,4 +27,4 @@ VOLUME /opt/bnbchaind EXPOSE 27146 27147 26660 -ENTRYPOINT ["entrypoint.sh"] +CMD ["bnbchaind start"] From 20b112295d9eb57a44c175bbbe90a53aff7b9cfe Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:43:45 +0700 Subject: [PATCH 5/6] Update docker-image.yml --- .github/workflows/docker-image.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b23f163..8c87636 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,5 +14,20 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build . --file docker/Dockerfile --tag faddat/bnc + + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + file: docker/Dockerfile + push: true + tags: ghcr.io/${{ github.repository_owner }}/bnc:latest From cb881bf2046a1a00918f8c283f1361d4faa3c8bb Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 31 May 2021 03:54:40 +0700 Subject: [PATCH 6/6] Update docker-image.yml --- .github/workflows/docker-image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8c87636..0645626 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -26,8 +26,7 @@ jobs: name: Build and push uses: docker/build-push-action@v2 with: - context: . - platforms: linux/amd64,linux/arm64 + context: docker file: docker/Dockerfile push: true tags: ghcr.io/${{ github.repository_owner }}/bnc:latest