From f84f054c575b7fee3f89c286480a19a10e5f36e6 Mon Sep 17 00:00:00 2001 From: silvana Date: Fri, 29 Nov 2024 06:10:57 +0100 Subject: [PATCH] switch to alpine as base image. --- .forgejo/workflows/test.yml | 12 +++++----- Dockerfile | 44 ++++++++++++++----------------------- entrypoint.sh | 2 +- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index f834ddb..85723f8 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -16,31 +16,31 @@ jobs: - uses: actions/checkout@v4 - name: Machete - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: cargo machete - name: Format - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: ${{ matrix.toolchain.name }} cargo fmt --check - name: Clippy - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: ${{ matrix.toolchain.name }} cargo clippy - name: Test - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: ${{ matrix.toolchain.name }} cargo test - name: Build - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: ${{ matrix.toolchain.name }} cargo build - name: Run - uses: https://git.kemitix.net/kemitix/rust@v2.4.1 + uses: https://git.ragarock.moe/silvana/setup-rust@v2.4.1 with: args: ${{ matrix.toolchain.name }} cargo run diff --git a/Dockerfile b/Dockerfile index aac1d00..f3fc653 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,21 @@ -FROM docker.io/rust:1.82.0-slim-bookworm +FROM rust:1.82-alpine3.20 -# nodejs - runtime used by forgejo/github actions -# curl - to download cargo-binstall -# clang-16 & mold - faster linkers for rust -# pkg-config - required to compile some rust `-sys` packages -# libssl-dev - build dependency for git-next -# libdbus-1-dev - linux os interop (e.g. desktop notifications) -# git - git -RUN apt-get update \ - && \ - apt-get satisfy -y "nodejs (>=18.19.0), curl (>=7.88.1), pkg-config (>=1.8.1), libssl-dev (>=3.0.14), git (>=2.39.2), libdbus-1-dev (>= 1.14.10), libtag1-dev (>= 1.13), libtagc0-dev (>= 1.13), xorg-dev (>=7.7), libxcb-shape0-dev (>=0.15), libxcb-xfixes0-dev (>=0.15)" \ - && \ - rm -r /var/lib/apt/lists/* - -RUN curl -L https://github.com/cargo-bins/cargo-binstall/releases/download/v1.10.12/cargo-binstall-x86_64-unknown-linux-musl.tgz -o cargo-binstall.tgz && \ - tar -xzf cargo-binstall.tgz && \ - rm cargo-binstall.tgz && \ - mv cargo-binstall /usr/local/bin/ - -RUN cargo binstall -y \ - cargo-chef@0.1 \ - cargo-hack@0.6 \ - cargo-machete@0.7 \ - cargo-mutants@24.11 \ - release-plz@0.3 +RUN apk update && \ + apk upgrade && \ + apk add git \ + bash \ + nodejs \ + clang \ + mold \ + musl-dev \ + pkgconfig \ + openssl-dev \ + pcc-libs-dev && \ + cargo install cargo-chef \ + cargo-hack \ + cargo-machete \ + cargo-mutants COPY entrypoint.sh / -RUN git config --global user.email "action@git.kemitix.net" && \ - git config --global user.name "ForgeJo Action. See: https://git.kemitix.net/kemitix/rust" - ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh index 195dda1..46cd394 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -47,4 +47,4 @@ COMMAND=$( # execute command echo ">>> ${PRE_COMMAND} ${COMMAND}" -${PRE_COMMAND} ${COMMAND} +${PRE_COMMAND} "${COMMAND}"