From 564998856017920bb3871fca06ebc7c500bce238 Mon Sep 17 00:00:00 2001 From: Nathan Garside Date: Thu, 9 Nov 2023 21:35:17 +0000 Subject: [PATCH] Publish distrobox image (#2) --- .github/workflows/distrobox.yml | 30 +++++++++++++++++++++++++ distrobox/containerfile | 40 +++++++++++++++++++++++++++++++++ distrobox/hashicorp.repo | 8 +++++++ distrobox/microsoft.repo | 8 +++++++ 4 files changed, 86 insertions(+) create mode 100644 .github/workflows/distrobox.yml create mode 100644 distrobox/containerfile create mode 100644 distrobox/hashicorp.repo create mode 100644 distrobox/microsoft.repo diff --git a/.github/workflows/distrobox.yml b/.github/workflows/distrobox.yml new file mode 100644 index 0000000..137a512 --- /dev/null +++ b/.github/workflows/distrobox.yml @@ -0,0 +1,30 @@ +# This is free and unencumbered software released into the public domain. + +name: distrobox + +on: + push: + branches: + - master + schedule: + - cron: 0 0 * * 0 + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + + - name: checkout + uses: actions/checkout@v3 + + - name: login + run: podman login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} + + - name: build + run: podman build --file distrobox/containerfile --tag ghcr.io/ngarside/distrobox:latest distrobox + + - name: push + run: podman push ghcr.io/ngarside/distrobox:latest diff --git a/distrobox/containerfile b/distrobox/containerfile new file mode 100644 index 0000000..410c3f9 --- /dev/null +++ b/distrobox/containerfile @@ -0,0 +1,40 @@ +# This is free and unencumbered software released into the public domain. + +FROM registry.opensuse.org/opensuse/distrobox:latest + +# Import RPM keys +RUN rpm --import https://rpm.releases.hashicorp.com/gpg +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc + +# Configure RPM repos +COPY hashicorp.repo /etc/zypp/repos.d/repo-hashicorp.repo +COPY microsoft.repo /etc/zypp/repos.d/repo-microsoft.repo + +# Install packages +RUN zypper --non-interactive install --no-recommends \ + ansible \ + azure-cli \ + dotnet-sdk-7.0 \ + git \ + hadolint \ + ImageMagick \ + just \ + jq \ + libgthread-2_0-0 \ + libXtst6 \ + npm \ + python3-rpm \ + python3-yamllint \ + ShellCheck \ + terraform \ + && zypper clean + +# Install Azure Artifacts credential provider +RUN mkdir /opt/nuget \ + && wget -O- \ + https://github.com/microsoft/artifacts-credprovider/releases/latest/download/Microsoft.Net6.NuGet.CredentialProvider.tar.gz \ + | tar --extract --gzip --directory /opt/nuget + +# Set default environment variables +ENV DOTNET_CLI_TELEMETRY_OPTOUT true +ENV NUGET_PLUGIN_PATHS /opt/nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll diff --git a/distrobox/hashicorp.repo b/distrobox/hashicorp.repo new file mode 100644 index 0000000..24f5d94 --- /dev/null +++ b/distrobox/hashicorp.repo @@ -0,0 +1,8 @@ +# This is free and unencumbered software released into the public domain. + +[repo-hashicorp] +baseurl = https://rpm.releases.hashicorp.com/fedora/38/$basearch/stable +enabled = 1 +gpgcheck = 1 +gpgkey = https://rpm.releases.hashicorp.com/gpg +name = repo-hashicorp diff --git a/distrobox/microsoft.repo b/distrobox/microsoft.repo new file mode 100644 index 0000000..4277bfe --- /dev/null +++ b/distrobox/microsoft.repo @@ -0,0 +1,8 @@ +# This is free and unencumbered software released into the public domain. + +[repo-microsoft] +baseurl = https://packages.microsoft.com/opensuse/15/prod +enabled = 1 +gpgcheck = 1 +gpgkey = https://packages.microsoft.com/keys/microsoft.asc +name = repo-microsoft