From 7b65d9106c857c098e3b212d1c5be2085b4b1216 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:41:45 +0000 Subject: [PATCH] build binary on runner --- .github/workflows/publish-docker.yml | 19 ++++++++++++++++++- docker/Tangle.Dockerfile | 18 ++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 26678c8fa..e38b119eb 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: - branches: [main] + branches: [main, update-docker] tags: ["v*.*.*"] env: @@ -52,6 +52,23 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image_name }} + - name: Install toolchain + id: toolchain + uses: actions-rs/toolchain@master + with: + profile: minimal + toolchain: nightly + target: wasm32-unknown-unknown + + - name: Rust Cache + uses: Swatinem/rust-cache@v1.3.0 + + - name: Install Protobuf + run: sudo apt-get install protobuf-compiler + + - name: Build binary + run: cargo build --release tangle + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image diff --git a/docker/Tangle.Dockerfile b/docker/Tangle.Dockerfile index 9a120bd83..1c43a1a14 100644 --- a/docker/Tangle.Dockerfile +++ b/docker/Tangle.Dockerfile @@ -12,22 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM docker.io/paritytech/ci-linux:production +FROM ubuntu:22.04 -ENV TZ=GMT -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -WORKDIR /tangle - -COPY . . - -# Install Required Packages -RUN apt-get update && apt-get install -y git && apt-get -y install sudo \ - cmake clang curl libssl-dev llvm libudev-dev \ - libgmp3-dev protobuf-compiler ca-certificates \ - && rm -rf /var/lib/apt/lists/* && update-ca-certificates - -RUN cargo build --locked --release --features txpool +COPY ./target/release/tangle /usr/local/bin/ LABEL maintainer="Webb Developers " LABEL description="Tangle Network Node" @@ -36,7 +23,6 @@ RUN useradd -m -u 5000 -U -s /bin/sh -d /tangle tangle && \ mkdir -p /data /tangle/.local/share && \ chown -R tangle:tangle /data && \ ln -s /data /tangle/.local/share/tangle && \ - cp /tangle/target/release/tangle /usr/local/bin && \ # unclutter and minimize the attack surface rm -rf /usr/bin /usr/sbin && \ # check if executable works in this container