From 01cd92b13ee6da5c0c0349294963f91e0c081728 Mon Sep 17 00:00:00 2001 From: Alexander Puck Neuwirth Date: Thu, 12 Dec 2024 17:47:18 +0100 Subject: [PATCH] split base --- .github/workflows/gentoo-base.yml | 71 +++++++++++++++++++++++++++++++ gentoo/base/Dockerfile | 14 ++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/gentoo-base.yml create mode 100644 gentoo/base/Dockerfile diff --git a/.github/workflows/gentoo-base.yml b/.github/workflows/gentoo-base.yml new file mode 100644 index 0000000..db82308 --- /dev/null +++ b/.github/workflows/gentoo-base.yml @@ -0,0 +1,71 @@ +name: gentoo-base Docker Image CI + + +on: + push: + branches: [ "master" ] + paths: + - gentoo/base/Dockerfile + - .github/workflows/gentoo-base.yml + schedule: + - cron: 0 6 1 * * + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + +jobs: + docker: + runs-on: ubuntu-latest + #runs-on: self-hosted + timeout-minutes: 43200 # 720h + strategy: + fail-fast: false + max-parallel: 1 + matrix: + user: ["apnpucky"] + base: ["gentoo"] + image: [ + "base", + ] + platforms: [ + "linux/amd64,linux/arm/v7,linux/arm64,linux/riscv64" + #,linux/ppc64le, #,linux/s390x, + ] + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Get current time + uses: josStorer/get-current-time@v2.0.2 + id: current-time + with: + format: YYYYMMDDHHSS + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config: .github/buildkitd.toml + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: ${{ matrix.base }}-${{ matrix.image }} + uses: docker/build-push-action@v3 + with: + file: gentoo/base/Dockerfile + platforms: ${{ matrix.platforms }} + push: true + target: ${{ matrix.base }}-${{ matrix.image }} + tags: | + ${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:latest + ${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ github.sha }}-latest + ${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ steps.current-time.outputs.formattedTime }}-latest diff --git a/gentoo/base/Dockerfile b/gentoo/base/Dockerfile new file mode 100644 index 0000000..22039ba --- /dev/null +++ b/gentoo/base/Dockerfile @@ -0,0 +1,14 @@ +FROM gentoo/portage:latest as portage-base +FROM gentoo/stage3:latest as gentoo-base +LABEL maintainer="APN-Pucky" +ARG NICENESS=14 +COPY --from=portage-base /var/db/repos/gentoo /var/db/repos/gentoo +RUN mkdir -p /etc/portage/repos.conf/ && cp /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.conf +RUN echo "PORTAGE_NICENESS=\"${NICENESS}\"" >> /etc/portage/make.conf +RUN echo "FEATURES=\"${FEATURES} getbinpkg\"" >> /etc/portage/make.conf +#RUN printf "" > /etc/portage/binrepos.conf/gentoobinhost.conf +RUN printf "[amd64gentoobinhost]\npriority=9999\nsync-uri=https://ftp.uni-stuttgart.de/gentoo-distfiles/releases/amd64/binpackages/23.0/x86-64/\n" > /etc/portage/binrepos.conf/amd64gentoobinhost.conf +RUN printf "[arm64gentoobinhost]\npriority=9999\nsync-uri=https://ftp.uni-stuttgart.de/gentoo-distfiles/releases/arm64/binpackages/23.0/arm64/\n" > /etc/portage/binrepos.conf/arm64gentoobinhost.conf +RUN printf "[armgentoobinhost]\npriority=9999\nsync-uri=https://ftp.uni-stuttgart.de/gentoo-distfiles/releases/arm/binpackages/23.0/armv7a_hf/\n" > /etc/portage/binrepos.conf/armgentoobinhost.conf +RUN printf "[riscvgentoobinhost]\npriority=9999\nsync-uri=https://ftp.uni-stuttgart.de/gentoo-distfiles/releases/riscv/binpackages/23.0/rv64_lp64d/\n" > /etc/portage/binrepos.conf/riscvgentoobinhost.conf +RUN mv /etc/portage/gnupg /etc/portage/gnupg.bak ; getuto \ No newline at end of file