From fce8117906428bf2b992c4f9ef429333068e5a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Assier=20=F0=9F=8C=A4=EF=B8=8F?= <18405490+GuillaumeASSIER@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:38:47 +0000 Subject: [PATCH] feat(Init): Create dev image --- .github/workflows/dev-build.yml | 92 +++++++++++++++++++++++++++++++++ README.md | 3 ++ dev/Dockerfile | 11 ++++ dev/dev.ini | 9 ++++ renovate.json | 6 +++ 5 files changed, 121 insertions(+) create mode 100644 .github/workflows/dev-build.yml create mode 100644 README.md create mode 100644 dev/Dockerfile create mode 100644 dev/dev.ini create mode 100644 renovate.json diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml new file mode 100644 index 0000000..55fa413 --- /dev/null +++ b/.github/workflows/dev-build.yml @@ -0,0 +1,92 @@ +name: Dev build + +on: + schedule: + - cron: '39 18 * * *' + push: + branches: [ "main" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install Cosign + uses: sigstore/cosign-installer@v3.7.0 + with: + cosign-release: 'v2.2.2' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # 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 + id: build-and-push + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 + with: + context: dev/ + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b86cb2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Distrobox images + + diff --git a/dev/Dockerfile b/dev/Dockerfile new file mode 100644 index 0000000..9b1ed27 --- /dev/null +++ b/dev/Dockerfile @@ -0,0 +1,11 @@ +FROM registry.fedoraproject.org/fedora-toolbox:41 + +# Upgrading image +RUN dnf update +RUN dnf upgrade + +# Install tollong +RUN dnf install git python3-firewall pipx just hugo opentofu go-task + +# Install SOPS +RUN dnf install https://github.com/getsops/sops/releases/download/v3.7.3/sops-3.7.3-1.x86_64.rpm diff --git a/dev/dev.ini b/dev/dev.ini new file mode 100644 index 0000000..0483943 --- /dev/null +++ b/dev/dev.ini @@ -0,0 +1,9 @@ +[dev] +additional_packages="git python3-firewall pipx just hugo opentofu go-task" +image=registry.fedoraproject.org/fedora-toolbox:41 +init=false +nvidia=false +pull=true +root=false +replace=true +start_now=true \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..d53b343 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} \ No newline at end of file