From 96d8eea2a538447278fe89cc7943aa6b5277de86 Mon Sep 17 00:00:00 2001 From: Daichi Sakaue Date: Tue, 9 Jan 2024 18:57:17 +0900 Subject: [PATCH] Migrate to ghcr.io Signed-off-by: Daichi Sakaue --- .github/workflows/release.yaml | 20 +++++++++++++------- Makefile | 2 +- README.md | 4 ++-- docker/Dockerfile | 3 ++- docs/getting_started.md | 2 +- mtest/Makefile | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7f902c6d..59942f31 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,25 +22,31 @@ jobs: - name: Build image run: make docker-build - - name: Push docker image to Quay.io + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push container image run: | - echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io echo "pushing Sabakan image ..." - docker tag quay.io/cybozu/sabakan:latest quay.io/cybozu/sabakan:${{ env.tag }} - docker push quay.io/cybozu/sabakan:${{ env.tag }} + docker tag ghcr.io/cybozu-go/sabakan:latest ghcr.io/cybozu-go/sabakan:${{ env.tag }} + docker push ghcr.io/cybozu-go/sabakan:${{ env.tag }} if ${{ env.prerelease }} ; then echo ===== Skip pushing branch tags for pre-release ${{ env.tag }} ===== exit 0 fi BRANCH=$(echo ${{ env.tag }} | cut -d "." -f 1-2) - docker tag quay.io/cybozu/sabakan:latest quay.io/cybozu/sabakan:$BRANCH - docker push quay.io/cybozu/sabakan:$BRANCH + docker tag ghcr.io/cybozu-go/sabakan:latest ghcr.io/cybozu-go/sabakan:$BRANCH + docker push ghcr.io/cybozu-go/sabakan:$BRANCH release-github: name: Release GitHub runs-on: ubuntu-22.04 container: - image: quay.io/cybozu/golang:1.20-jammy # used for ghr, not for go command + image: ghcr.io/cybozu/golang:1.20-jammy # used for ghr, not for go command steps: - name: Create GitHub release run: | diff --git a/Makefile b/Makefile index 01ea16f4..4b82706c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ETCD_VERSION = 3.5.7 GO_FILES=$(shell find -name '*.go' -not -name '*_test.go') BUILT_TARGET=sabakan sabactl sabakan-cryptsetup -IMAGE ?= quay.io/cybozu/sabakan +IMAGE ?= ghcr.io/cybozu-go/sabakan TAG ?= latest CFSSL_VER = 1.6.4 CFSSL = /usr/local/bin/cfssl diff --git a/README.md b/README.md index e5c380fb..97cb0ec1 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ $ sudo mkdir -p /var/lib/sabakan $ docker run -d --read-only --cap-drop ALL --cap-add NET_BIND_SERVICE \ --network host --name sabakan \ --mount type=bind,source=/var/lib/sabakan,target=/var/lib/sabakan \ - quay.io/cybozu/sabakan:2.2 \ + ghcr.io/cybozu-go/sabakan:3.1 \ -etcd-endpoints http://foo.bar:2379,http://zot.bar:2379 \ -advertise-url http://12.34.56.78:10080 ``` @@ -124,7 +124,7 @@ Sabakan is licensed under the Apache License, Version 2.0. Docker images ------------- -Docker images are available on [Quay.io](https://quay.io/repository/cybozu/sabakan) +Docker images are available on [ghcr.io](https://github.com/cybozu-go/sabakan/pkgs/container/sabakan) [releases]: https://github.com/cybozu-go/sabakan/releases [etcd]: https://coreos.com/etcd/ diff --git a/docker/Dockerfile b/docker/Dockerfile index 4c730304..c7239096 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,6 @@ # Sabakan container -FROM quay.io/cybozu/ubuntu:22.04 +FROM ghcr.io/cybozu/ubuntu:22.04 +LABEL org.opencontainers.image.source="https://github.com/cybozu-go/sabakan" RUN apt-get update \ && apt-get -y install --no-install-recommends grub-ipxe \ diff --git a/docs/getting_started.md b/docs/getting_started.md index f021dd60..0b5abb40 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -64,7 +64,7 @@ A sample systemd service file is available at [pkg/sabakan/sabakan.service](../pkg/sabakan/sabakan.service). Alternatively, you may use docker to run sabakan: -* Repository: [quay.io/cybozu/sabakan](https://quay.io/cybozu/sabakan) +* Repository: [ghcr.io/cybozu-go/sabakan](https://github.com/cybozu-go/sabakan/pkgs/container/sabakan) * Usage: https://github.com/cybozu/neco-containers/blob/main/sabakan/README.md ## Netboot diff --git a/mtest/Makefile b/mtest/Makefile index 26edf857..b7f403a9 100644 --- a/mtest/Makefile +++ b/mtest/Makefile @@ -27,7 +27,7 @@ SSH_PRIVKEY = $(realpath ./mtest_key) OUTPUT := ./output COREOS_IMAGE := flatcar_production_qemu_image.img SABAKAN_IMAGE := $(abspath $(OUTPUT))/sabakan.img -SABAKAN_IMAGE_NAME := quay.io/cybozu/sabakan +SABAKAN_IMAGE_NAME := ghcr.io/cybozu-go/sabakan SABAKAN_IMAGE_TAG := dev SABAKAN_IMAGE_URL := $(SABAKAN_IMAGE_NAME):$(SABAKAN_IMAGE_TAG) CT := $(abspath $(OUTPUT))/ct