From e70b9689241785df1ff509678d99f1fdcb138d91 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 8 Jul 2022 02:21:51 +0200 Subject: [PATCH] fix: use docker images from dockerhub (#1249) --- IMAGES.md | 14 +++++++------- README.md | 10 +++++----- cmd/root.go | 4 ++-- pkg/runner/runner_test.go | 8 ++++---- .../testdata/job-container-non-root/push.yml | 2 +- pkg/runner/testdata/shells/custom/push.yml | 2 +- pkg/runner/testdata/shells/pwsh/push.yml | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/IMAGES.md b/IMAGES.md index dd8ac581..a6862f0f 100644 --- a/IMAGES.md +++ b/IMAGES.md @@ -19,10 +19,10 @@ | Image | GitHub Repository | | -------------------------------------------------------------------- | ------------------------------------------------------------- | -| [`ghcr.io/catthehacker/ubuntu:act-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | -| [`ghcr.io/catthehacker/ubuntu:act-22.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | -| [`ghcr.io/catthehacker/ubuntu:act-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | -| [`ghcr.io/catthehacker/ubuntu:act-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | +| [`catthehacker/ubuntu:act-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | +| [`catthehacker/ubuntu:act-22.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | +| [`catthehacker/ubuntu:act-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | +| [`catthehacker/ubuntu:act-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] | ## Images based on [`actions/virtual-environments`][gh/actions/virtual-environments] @@ -36,9 +36,9 @@ | Image | GitHub Repository | | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| [`ghcr.io/catthehacker/ubuntu:full-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | -| [`ghcr.io/catthehacker/ubuntu:full-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | -| [`ghcr.io/catthehacker/ubuntu:full-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | +| [`catthehacker/ubuntu:full-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | +| [`catthehacker/ubuntu:full-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | +| [`catthehacker/ubuntu:full-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] | Feel free to make a pull request with your image added here diff --git a/README.md b/README.md index ffb5093d..15cbe638 100644 --- a/README.md +++ b/README.md @@ -254,10 +254,10 @@ GitHub Actions offers managed [virtual environments](https://help.github.com/en/ | GitHub Runner | Micro Docker Image | Medium Docker Image | Large Docker Image | | --------------- | -------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------- | -| `ubuntu-latest` | [`node:16-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-latest`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-latest`][docker_images] | -| `ubuntu-22.04` | [`node:16-bullseye-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-22.04`][docker_images] | `unavailable` | -| `ubuntu-20.04` | [`node:16-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-20.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-20.04`][docker_images] | -| `ubuntu-18.04` | [`node:16-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-18.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-18.04`][docker_images] | +| `ubuntu-latest` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-latest`][docker_images] | [`catthehacker/ubuntu:full-latest`][docker_images] | +| `ubuntu-22.04` | [`node:16-bullseye-slim`][micro] | [`catthehacker/ubuntu:act-22.04`][docker_images] | `unavailable` | +| `ubuntu-20.04` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-20.04`][docker_images] | [`catthehacker/ubuntu:full-20.04`][docker_images] | +| `ubuntu-18.04` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-18.04`][docker_images] | [`catthehacker/ubuntu:full-18.04`][docker_images] | [micro]: https://hub.docker.com/_/buildpack-deps [docker_images]: https://github.com/catthehacker/docker_images @@ -281,7 +281,7 @@ If you need an environment that works just like the corresponding GitHub runner :warning: :elephant: `*** WARNING - this image is >18GB 😱***` -- [`ghcr.io/catthehacker/ubuntu:full-*`](https://github.com/catthehacker/docker_images/pkgs/container/ubuntu) - built from Packer template provided by GitHub, see [catthehacker/virtual-environments-fork](https://github.com/catthehacker/virtual-environments-fork) or [catthehacker/docker_images](https://github.com/catthehacker/docker_images) for more information +- [`catthehacker/ubuntu:full-*`](https://github.com/catthehacker/docker_images/pkgs/container/ubuntu) - built from Packer template provided by GitHub, see [catthehacker/virtual-environments-fork](https://github.com/catthehacker/virtual-environments-fork) or [catthehacker/docker_images](https://github.com/catthehacker/docker_images) for more information ## Use an alternative runner image diff --git a/cmd/root.go b/cmd/root.go index d2b2214a..73c1764f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -443,9 +443,9 @@ func defaultImageSurvey(actrc string) error { var option string switch answer { case "Large": - option = "-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-latest\n-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-20.04\n-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:full-18.04\n" + option = "-P ubuntu-latest=catthehacker/ubuntu:full-latest\n-P ubuntu-latest=catthehacker/ubuntu:full-20.04\n-P ubuntu-18.04=catthehacker/ubuntu:full-18.04\n" case "Medium": - option = "-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest\n-P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04\n-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04\n-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04\n" + option = "-P ubuntu-latest=catthehacker/ubuntu:act-latest\n-P ubuntu-22.04=catthehacker/ubuntu:act-22.04\n-P ubuntu-20.04=catthehacker/ubuntu:act-20.04\n-P ubuntu-18.04=catthehacker/ubuntu:act-18.04\n" case "Micro": option = "-P ubuntu-latest=node:16-buster-slim\n-P -P ubuntu-22.04=node:16-bullseye-slim\n ubuntu-20.04=node:16-buster-slim\n-P ubuntu-18.04=node:16-buster-slim\n" } diff --git a/pkg/runner/runner_test.go b/pkg/runner/runner_test.go index c116bc54..8f166a3b 100644 --- a/pkg/runner/runner_test.go +++ b/pkg/runner/runner_test.go @@ -121,8 +121,8 @@ func TestRunEvent(t *testing.T) { // Shells {workdir, "shells/defaults", "push", "", platforms}, // TODO: figure out why it fails - // {workdir, "shells/custom", "push", "", map[string]string{"ubuntu-latest": "ghcr.io/justingrote/act-pwsh:latest"}, }, // custom image with pwsh - {workdir, "shells/pwsh", "push", "", map[string]string{"ubuntu-latest": "ghcr.io/justingrote/act-pwsh:latest"}}, // custom image with pwsh + // {workdir, "shells/custom", "push", "", map[string]string{"ubuntu-latest": "catthehacker/ubuntu:pwsh-latest"}, }, // custom image with pwsh + {workdir, "shells/pwsh", "push", "", map[string]string{"ubuntu-latest": "catthehacker/ubuntu:pwsh-latest"}}, // custom image with pwsh {workdir, "shells/bash", "push", "", platforms}, {workdir, "shells/python", "push", "", map[string]string{"ubuntu-latest": "node:16-buster"}}, // slim doesn't have python {workdir, "shells/sh", "push", "", platforms}, @@ -158,7 +158,7 @@ func TestRunEvent(t *testing.T) { {workdir, "container-hostname", "push", "", platforms}, {workdir, "remote-action-docker", "push", "", platforms}, {workdir, "remote-action-js", "push", "", platforms}, - {workdir, "remote-action-js", "push", "", map[string]string{"ubuntu-latest": "ghcr.io/catthehacker/ubuntu:runner-latest"}}, // Test if this works with non root container + {workdir, "remote-action-js", "push", "", map[string]string{"ubuntu-latest": "catthehacker/ubuntu:runner-latest"}}, // Test if this works with non root container {workdir, "matrix", "push", "", platforms}, {workdir, "matrix-include-exclude", "push", "", platforms}, {workdir, "commands", "push", "", platforms}, @@ -199,7 +199,7 @@ func TestDryrunEvent(t *testing.T) { tables := []TestJobFileInfo{ // Shells {workdir, "shells/defaults", "push", "", platforms}, - {workdir, "shells/pwsh", "push", "", map[string]string{"ubuntu-latest": "ghcr.io/justingrote/act-pwsh:latest"}}, // custom image with pwsh + {workdir, "shells/pwsh", "push", "", map[string]string{"ubuntu-latest": "catthehacker/ubuntu:pwsh-latest"}}, // custom image with pwsh {workdir, "shells/bash", "push", "", platforms}, {workdir, "shells/python", "push", "", map[string]string{"ubuntu-latest": "node:16-buster"}}, // slim doesn't have python {workdir, "shells/sh", "push", "", platforms}, diff --git a/pkg/runner/testdata/job-container-non-root/push.yml b/pkg/runner/testdata/job-container-non-root/push.yml index 5fd296a0..1fe0e3be 100644 --- a/pkg/runner/testdata/job-container-non-root/push.yml +++ b/pkg/runner/testdata/job-container-non-root/push.yml @@ -5,6 +5,6 @@ jobs: test: runs-on: ubuntu-latest container: - image: ghcr.io/catthehacker/ubuntu:runner-latest # image with user 'runner:runner' built on tag 'act-latest' + image: catthehacker/ubuntu:runner-latest # image with user 'runner:runner' built on tag 'act-latest' steps: - run: echo PASS diff --git a/pkg/runner/testdata/shells/custom/push.yml b/pkg/runner/testdata/shells/custom/push.yml index d5086af9..cbc03955 100644 --- a/pkg/runner/testdata/shells/custom/push.yml +++ b/pkg/runner/testdata/shells/custom/push.yml @@ -8,7 +8,7 @@ jobs: run: '' check-container: runs-on: ubuntu-latest - container: ghcr.io/justingrote/act-pwsh:latest + container: catthehacker/ubuntu:pwsh-latest steps: - shell: pwsh -v '. {0}' run: '' diff --git a/pkg/runner/testdata/shells/pwsh/push.yml b/pkg/runner/testdata/shells/pwsh/push.yml index d1aa0da9..25ce66b4 100644 --- a/pkg/runner/testdata/shells/pwsh/push.yml +++ b/pkg/runner/testdata/shells/pwsh/push.yml @@ -10,7 +10,7 @@ jobs: $PSVersionTable check-container: runs-on: ubuntu-latest - container: ghcr.io/justingrote/act-pwsh:latest + container: catthehacker/ubuntu:pwsh-latest steps: - shell: ${{ env.MY_SHELL }} run: |