Skip to content

Commit

Permalink
Publish the Ubuntu images at quay.io/toolbx/ubuntu-toolbox:22.04, etc.
Browse files Browse the repository at this point in the history
Build and push when there are changes in the `images/ubuntu` directory
or in the GitHub workflow itself, as well as every other week (7th and
21st days of a month to be precise).

Until now, the Ubuntu images (versions 16.04, 18.04, 20.04, 22.04 and
22.10) were published at quay.io/toolbx-images/ubuntu-toolbox:22.04,
etc..  This changes the location to quay.io/toolbx/ubuntu-toolbox:22.04
and builds an image for Ubuntu 23.04 that was added recently [1].

Note that the changes to the toolbox(1) code and the system tests cannot
be tested until the first round of images are available from the new
location.

[1] Commit 3cfb6bf
    containers#1292

containers#483

Signed-off-by: Ievgen Popovych <[email protected]>
  • Loading branch information
Jmennius authored and debarshiray committed Jun 8, 2023
1 parent 4a1d9fc commit 8e912ee
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 8 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ubuntu-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Images: Build and push Ubuntu toolbx images"

on:
push:
branches:
- main
paths:
- images/ubuntu/**
- .github/workflows/ubuntu-images.yaml
schedule:
- cron: '0 0 * * MON'

# Prevent multiple workflow runs from racing
concurrency: ${{ github.workflow }}

env:
latest_release: '22.04'

jobs:
build-and-push-images:
strategy:
matrix:
release: ['16.04', '18.04', '20.04', '22.04', '22.10', '23.04']

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: 'toolbx+github'
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push Ubuntu ${{ matrix.release }} toolbox image
uses: docker/build-push-action@v3
with:
context: images/ubuntu/${{ matrix.release }}
file: images/ubuntu/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: quay.io/toolbx/ubuntu-toolbox:${{ matrix.release }}

- name: Push latest tag
if: env.latest_release == matrix.release
uses: docker/build-push-action@v3
with:
context: images/ubuntu/${{ matrix.release }}
file: images/ubuntu/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: quay.io/toolbx/ubuntu-toolbox:latest
2 changes: 1 addition & 1 deletion src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func getFullyQualifiedImageRHEL(image, release string) string {
}

func getFullyQualifiedImageUbuntu(image, release string) string {
imageFull := "quay.io/toolbx-images/" + image
imageFull := "quay.io/toolbx/" + image
return imageFull
}

Expand Down
12 changes: 6 additions & 6 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:16.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:16.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand All @@ -203,7 +203,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list --images

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:16.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:16.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand All @@ -218,7 +218,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:18.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:18.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand All @@ -233,7 +233,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list --images

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:18.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:18.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand All @@ -248,7 +248,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:20.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:20.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand All @@ -263,7 +263,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list --images

assert_success
assert_line --index 1 --partial "quay.io/toolbx-images/ubuntu-toolbox:20.04"
assert_line --index 1 --partial "quay.io/toolbx/ubuntu-toolbox:20.04"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
Expand Down
2 changes: 1 addition & 1 deletion test/system/libs/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ declare -Ag IMAGES=([busybox]="quay.io/toolbox_tests/busybox" \
[docker-reg]="quay.io/toolbox_tests/registry" \
[fedora]="registry.fedoraproject.org/fedora-toolbox" \
[rhel]="registry.access.redhat.com/ubi8/toolbox" \
[ubuntu]="quay.io/toolbx-images/ubuntu-toolbox")
[ubuntu]="quay.io/toolbx/ubuntu-toolbox")


function cleanup_all() {
Expand Down

0 comments on commit 8e912ee

Please sign in to comment.