Skip to content

Commit

Permalink
build binary on runner
Browse files Browse the repository at this point in the history
  • Loading branch information
1xstj committed Feb 15, 2024
1 parent a843998 commit 7b65d91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

push:
branches: [main]
branches: [main, update-docker]
tags: ["v*.*.*"]

env:
Expand Down Expand Up @@ -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/[email protected]

- 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
Expand Down
18 changes: 2 additions & 16 deletions docker/Tangle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
LABEL description="Tangle Network Node"
Expand All @@ -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
Expand Down

0 comments on commit 7b65d91

Please sign in to comment.