From 995d4902084cc5143035db8c651f7b2413c5e069 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Sat, 27 Jan 2024 17:30:07 +0200 Subject: [PATCH] new base - rust-build (#32) --- .github/workflows/rust-build.yaml | 36 +++++++++++++++++++++++++++++++ rust-build/Dockerfile | 8 +++++++ rust-build/README | 1 + 3 files changed, 45 insertions(+) create mode 100644 .github/workflows/rust-build.yaml create mode 100644 rust-build/Dockerfile create mode 100644 rust-build/README diff --git a/.github/workflows/rust-build.yaml b/.github/workflows/rust-build.yaml new file mode 100644 index 0000000..0c14037 --- /dev/null +++ b/.github/workflows/rust-build.yaml @@ -0,0 +1,36 @@ +name: Release rust base images +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + builder: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: rust-build/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/metalbear-co/ci-rust-build:latest + ghcr.io/metalbear-co/ci-rust-build:${{ github.sha }} \ No newline at end of file diff --git a/rust-build/Dockerfile b/rust-build/Dockerfile new file mode 100644 index 0000000..19c1075 --- /dev/null +++ b/rust-build/Dockerfile @@ -0,0 +1,8 @@ +FROM buildpack-deps:bookworm as base + +RUN apt-get update && apt-get install -y protobuf-compiler +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh +RUN chmod +x rustup-init.sh +RUN ./rustup-init.sh -y -c rustfmt --default-toolchain nightly-2023-12-07 +ENV PATH="$PATH:/root/.cargo/bin" +RUN rustup target add --toolchain nightly-2023-12-07 \ No newline at end of file diff --git a/rust-build/README b/rust-build/README new file mode 100644 index 0000000..1bf56eb --- /dev/null +++ b/rust-build/README @@ -0,0 +1 @@ +Rust + Nightly and protobuf, that's it. \ No newline at end of file