Skip to content

Commit

Permalink
Merge pull request #232 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
Migrate from Docker Hub to GHCR
  • Loading branch information
AkihiroSuda authored Jun 24, 2021
2 parents 91a41f8 + 49ffbe6 commit f1845d2
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Adopted from https://github.com/docker/metadata-action/tree/v3.3.0#basic
# (Apache License 2.0)
name: GHCR

on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'

jobs:
ghcr:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
make clean
docker builder prune -a -f
- name: "Smoke test (containerd, w/o cgroups)"
run: ./hack/smoketest-docker.sh u7s-test-containerd rootlesscontainers/usernetes --cri=containerd
run: ./hack/smoketest-docker.sh u7s-test-containerd ghcr.io/rootless-containers/usernetes --cri=containerd
- name: "Smoke test (CRI-O, w/o cgroups)"
run: ./hack/smoketest-docker.sh u7s-test-crio rootlesscontainers/usernetes --cri=crio
run: ./hack/smoketest-docker.sh u7s-test-crio ghcr.io/rootless-containers/usernetes --cri=crio
- name: "Smoke test (multi-node cluster with Flannel)"
run: ./hack/smoketest-docker-compose.sh
fedora:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# targets prefixed with underscore are not intended be invoked by human

.DEFAULT_GOAL := binaries
IMAGE=rootlesscontainers/usernetes
IMAGE=ghcr.io/rootless-containers/usernetes

binaries: image _binaries

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,23 @@ $ eval $(./show-cleanup-command.sh)

## Run Usernetes in Docker

All-in-one Docker image is available as [`rootlesscontainers/usernetes`](https://hub.docker.com/r/rootlesscontainers/usernetes) on Docker Hub.
All-in-one Docker image is available as [`ghcr.io/rootless-containers/usernetes`](https://ghcr.io/rootless-containers/usernetes) on GHCR.

:warning: [`rootlesscontainers/usernetes`](https://hub.docker.com/r/rootlesscontainers/usernetes) on Docker Hub is no longer updated.
Please use the GHCR image.

To build the image manually:

```console
$ docker build -t rootlesscontainers/usernetes .
$ docker build -t ghcr.io/rootless-containers/usernetes .
```

The image is based on Fedora.

### Single node

```console
$ docker run -td --name usernetes-node -p 127.0.0.1:6443:6443 --privileged rootlesscontainers/usernetes --cri=containerd
$ docker run -td --name usernetes-node -p 127.0.0.1:6443:6443 --privileged ghcr.io/rootless-containers/usernetes --cri=containerd
```

Wait until `docker ps` shows "healty" as the status of `usernetes-node` container.
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
init-certs:
image: rootlesscontainers/usernetes
image: ghcr.io/rootless-containers/usernetes
entrypoint: /docker-entrypoint.sh
command:
- unsudo
Expand All @@ -19,7 +19,7 @@ services:
- tls-node-crio:/home/user/.config/usernetes/nodes.node-crio
- tls-node-containerd:/home/user/.config/usernetes/nodes.node-containerd
master:
image: rootlesscontainers/usernetes
image: ghcr.io/rootless-containers/usernetes
command:
- --wait-init-certs
- --start=u7s-master-with-etcd.target
Expand All @@ -39,7 +39,7 @@ services:
volumes:
- tls-master:/home/user/.config/usernetes/master
node-crio:
image: rootlesscontainers/usernetes
image: ghcr.io/rootless-containers/usernetes
command:
- --wait-init-certs
- --start=u7s-node.target
Expand All @@ -60,7 +60,7 @@ services:
# (currently required because master and flanneld share the same etcd cluster)
- tls-master:/home/user/.config/usernetes/master
node-containerd:
image: rootlesscontainers/usernetes
image: ghcr.io/rootless-containers/usernetes
command:
- --wait-init-certs
- --start=u7s-node.target
Expand Down
2 changes: 1 addition & 1 deletion hack/smoketest-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ args=$@

set -x
tmpdir=$(mktemp -d)
docker run -td --name $container -p 127.0.0.1:6443:6443 --privileged rootlesscontainers/usernetes $args
docker run -td --name $container -p 127.0.0.1:6443:6443 --privileged ghcr.io/rootless-containers/usernetes $args
function cleanup() {
docker rm -f $container
rm -rf $tmpdir
Expand Down

0 comments on commit f1845d2

Please sign in to comment.