Skip to content

Commit

Permalink
Migrate to ghcr.io
Browse files Browse the repository at this point in the history
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
  • Loading branch information
yokaze committed Jan 9, 2024
1 parent 3b1665d commit 96d8eea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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/
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

## <a name="netboot" />Netboot
Expand Down
2 changes: 1 addition & 1 deletion mtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96d8eea

Please sign in to comment.