diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml new file mode 100644 index 0000000..e48b3fd --- /dev/null +++ b/.gitea/workflows/container.yaml @@ -0,0 +1,12 @@ +name: Build Multiarch Container Image +on: [push] +jobs: + call-reusable-workflow: + uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main + with: + repository: ${{ gitea.repository }} + ref_name: ${{ gitea.ref_name }} + sha: ${{ gitea.sha }} + registry_url: ${{ secrets.REGISTRY_URL }} + registry_user: ${{ secrets.REGISTRY_USER }} + registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index efb62a7..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,11 +0,0 @@ -pipeline: - publish-docker-image: - image: plugins/kaniko - settings: - repo: docker.io/thallian/fp-feed - tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG=pre} - dockerfile: Containerfile - username: - from_secret: DOCKER_USER - password: - from_secret: DOCKER_PW diff --git a/Containerfile b/Containerfile index aa08e08..e6186da 100644 --- a/Containerfile +++ b/Containerfile @@ -1,26 +1,23 @@ FROM docker.io/rust:1-alpine3.18 AS builder -ARG ARCH=x86_64 - RUN apk --no-cache add musl-dev ENV CARGO_CARGO_NEW_VCS="none" ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static" -ENV CARGO_BUILD_TARGET="$ARCH-unknown-linux-musl" WORKDIR /work RUN cargo init COPY Cargo.toml Cargo.lock ./ -RUN cargo build --release +RUN cargo build --release --target=$(arch)-unknown-linux-musl COPY . . # ensure rebuilding of the app RUN touch src/main.rs -RUN cargo build --release -RUN cp "./target/$CARGO_BUILD_TARGET/release/findpenguins-feed" /app +RUN cargo build --release --target=$(arch)-unknown-linux-musl +RUN cp "./target/$(arch)-unknown-linux-musl/release/findpenguins-feed" /app FROM scratch