Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Publish images on Quay.io #4860

Merged
merged 8 commits into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 45 additions & 5 deletions .github/workflows/docker-image.yml
Expand Up @@ -6,7 +6,6 @@ on:
- v*
branches:
- master
- test-quay

defaults:
run:
Expand Down Expand Up @@ -36,11 +35,18 @@ jobs:
${{ runner.os }}-${{ matrix.platform }}-${{ matrix.target }}-buildx-

- name: Docker Login
uses: Azure/docker-login@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Docker Login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Docker Buildx
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -63,6 +69,14 @@ jobs:
--target $TARGET \
--tag $image_name .

docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .
Comment on lines +72 to +78
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, we cannot simply build the image once and re-tag because docker buildx build pushes manifests to the registry as part of the process

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do do this when possible though -- when building the windows image


build-linux-arm64:
name: Build & push linux/arm64
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,11 +105,18 @@ jobs:
${{ runner.os }}-${{ matrix.platform }}-${{ matrix.target }}-buildx-

- name: Docker Login
uses: Azure/docker-login@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Docker Login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Docker Buildx
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -118,6 +139,14 @@ jobs:
--target $TARGET \
--tag $image_name .

docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .

build-windows:
name: Build & push windows
runs-on: windows-2019
Expand All @@ -128,6 +157,14 @@ jobs:
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Login to Quay
uses: Azure/docker-login@v1
with:
login-server: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Build & Push Windows Docker Images
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -144,6 +181,9 @@ jobs:
image_name="${docker_org}/${target}:${tag}-windows"
docker build --target $target -t $image_name -f Dockerfile.windows .
docker push $image_name

docker tag $image_name quay.io/$image_name
docker push quay.io/$image_name
done

push-linux-amd64-images:
Expand Down Expand Up @@ -183,7 +223,7 @@ jobs:
image_name="${docker_org}/${target}:${tag}"

docker manifest create $image_name ${image_name}-linux-amd64
docker manifest create quay.io/$image_name ${image_name}-linux-amd64
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-amd64

docker manifest push $image_name
docker manifest push quay.io/$image_name
Expand Down Expand Up @@ -227,7 +267,7 @@ jobs:

if [ $target = "argoexec" ]; then
docker manifest create $image_name ${image_name}-linux-arm64 ${image_name}-linux-amd64 ${image_name}-windows
docker manifest create quay.io/$image_name ${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64 quay.io/${image_name}-windows
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64 quay.io/${image_name}-windows
else
docker manifest create $image_name ${image_name}-linux-arm64 ${image_name}-linux-amd64
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64
Expand Down