Skip to content

Commit

Permalink
use GHCR image by default
Browse files Browse the repository at this point in the history
Updates examples, CI and docs to use
the GHCR image by default. The Docker
Hub image will continue to be pushed
for the time being to help migration.

Updates projectcontour#3998.

Signed-off-by: Steve Kriss <krisss@vmware.com>
  • Loading branch information
skriss committed Sep 1, 2021
1 parent 4bdb0b6 commit 08db655
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REGISTRY: projectcontour
REGISTRY: docker.io/projectcontour
VERSION: main
TAG_LATEST: "false"
PUSH_IMAGE: "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
version: latest
- name: Build and Push to Docker Hub
env:
REGISTRY: docker.io/projectcontour
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TAG_LATEST: "false"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
NODEIMAGE: ${{ matrix.node_image }}
LOAD_PREBUILT_IMAGE: "true"
run: |
export CONTOUR_UPGRADE_TO_IMAGE="projectcontour/contour:$(ls ./image/contour-*.tar | sed -E 's/.*-(.*).tar/\1/')"
export CONTOUR_UPGRADE_TO_IMAGE="ghcr.io/projectcontour/contour:$(ls ./image/contour-*.tar | sed -E 's/.*-(.*).tar/\1/')"
make upgrade
- uses: act10ns/slack@v1
with:
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,24 +244,24 @@ xdscache_v3 "github.com/projectcontour/contour/internal/xdscache/v3"
Before a change is submitted it should pass all the pre commit CI jobs.
If there are unrelated test failures the change can be merged so long as a reference to an issue that tracks the test failures is provided.

Once a change lands in main it will be built and available at this tag, `docker.io/projectcontour/contour:main`.
Once a change lands in main it will be built and available at this tag, `ghcr.io/projectcontour/contour:main`.
You can read more about the available contour images in the [tagging][7] document.

### Build an image

To build an image of your change using Contour's `Dockerfile`, run these commands (replacing the repository host and tag with your own):

```
docker build -t docker.io/davecheney/contour:latest .
docker push docker.io/davecheney/contour:latest
docker build -t ghcr.io/davecheney/contour:latest .
docker push ghcr.io/davecheney/contour:latest
```
or, you can use the make helper, like so:

```
REGISTRY=docker.io/davecheney VERSION=latest make push
REGISTRY=ghcr.io/davecheney VERSION=latest make push
```

This will push to `:latest` in `docker.io/davecheney` obviously you'll also need to replace the repo host with your own here too. If you don't specify `VERSION`, `make push` will push to a git hash tag (the output of ` git rev-parse --short=8 --verify HEAD`).
This will push to `:latest` in `ghcr.io/davecheney` obviously you'll also need to replace the repo host with your own here too. If you don't specify `VERSION`, `make push` will push to a git hash tag (the output of ` git rev-parse --short=8 --verify HEAD`).

### Verify your change

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ORG = projectcontour
PROJECT = contour
MODULE = github.com/$(ORG)/$(PROJECT)
REGISTRY ?= projectcontour
REGISTRY ?= ghcr.io/projectcontour
IMAGE := $(REGISTRY)/$(PROJECT)
SRCDIRS := ./cmd ./internal ./apis
LOCAL_BOOTSTRAP_CONFIG = localenvoyconfig.yaml
Expand All @@ -19,7 +19,7 @@ LOCALIP ?= $(shell ifconfig | grep inet | grep -v '::' | grep -v 127.0.0.1 | hea
CONTOUR_E2E_LOCAL_HOST ?= $(LOCALIP)
# Variables needed for running upgrade tests.
CONTOUR_UPGRADE_FROM_VERSION ?= $(shell ./test/scripts/get-contour-upgrade-from-version.sh)
CONTOUR_UPGRADE_TO_IMAGE ?= projectcontour/contour:main
CONTOUR_UPGRADE_TO_IMAGE ?= ghcr.io/projectcontour/contour:main

TAG_LATEST ?= false

Expand Down
2 changes: 1 addition & 1 deletion examples/contour/02-job-certgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
spec:
containers:
- name: contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
Expand Down
2 changes: 1 addition & 1 deletion examples/contour/03-contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour
ports:
Expand Down
4 changes: 2 additions & 2 deletions examples/contour/03-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
args:
- envoy
- shutdown-manager
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
Expand Down Expand Up @@ -113,7 +113,7 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: envoy-initconfig
volumeMounts:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ spec:
spec:
containers:
- name: contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
Expand Down Expand Up @@ -2996,7 +2996,7 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
name: contour
ports:
Expand Down Expand Up @@ -3085,7 +3085,7 @@ spec:
args:
- envoy
- shutdown-manager
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
Expand Down Expand Up @@ -3169,7 +3169,7 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
name: envoy-initconfig
volumeMounts:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2722,7 +2722,7 @@ spec:
spec:
containers:
- name: contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
Expand Down Expand Up @@ -2993,7 +2993,7 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
name: contour
ports:
Expand Down Expand Up @@ -3082,7 +3082,7 @@ spec:
args:
- envoy
- shutdown-manager
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
Expand Down Expand Up @@ -3166,7 +3166,7 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: IfNotPresent
name: envoy-initconfig
volumeMounts:
Expand Down
6 changes: 3 additions & 3 deletions hack/release/make-release-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

readonly IMG="docker.io/projectcontour/contour:$NEWVERS"
readonly IMG="ghcr.io/projectcontour/contour:$NEWVERS"

if [ -n "$(git tag --list "$NEWVERS")" ]; then
printf "%s: tag '%s' already exists\n" "$PROGNAME" "$NEWVERS"
Expand All @@ -39,8 +39,8 @@ for example in examples/contour/03-envoy.yaml examples/contour/03-contour.yaml e
# The version might be main or OLDVERS depending on whether we are
# tagging from the release branch or from main.
run::sed \
"-es|docker.io/projectcontour/contour:main|$IMG|" \
"-es|docker.io/projectcontour/contour:$OLDVERS|$IMG|" \
"-es|ghcr.io/projectcontour/contour:main|$IMG|" \
"-es|ghcr.io/projectcontour/contour:$OLDVERS|$IMG|" \
"$example"
done

Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/main/redeploy-envoy.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ It exposes two HTTP endpoints which are used for `livenessProbe` as well as to h
args:
- envoy
- shutdown-manager
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
Expand Down Expand Up @@ -76,4 +76,4 @@ The shutdown command has a few arguments that can be passed to change how it beh
| <nobr>admin-port (Deprecated)</nobr> | integer | 9001 | Deprecated: No longer used, Envoy admin interface runs as a unix socket. |
| <nobr>admin-address</nobr> | string | /admin/admin.sock | Path to Envoy admin unix domain socket. |

[1]: ../img/shutdownmanager.png
[1]: ../img/shutdownmanager.png
2 changes: 1 addition & 1 deletion site/content/examples/authdemo/02-certsjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
spec:
containers:
- name: contour
image: docker.io/projectcontour/contour:main
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/install-contour-working.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ if [ "${LOAD_PREBUILT_IMAGE}" = "true" ]; then
else
# Build the current version of Contour.
VERSION="v$$"
make -C ${REPO} container IMAGE=docker.io/projectcontour/contour VERSION=$VERSION
make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=$VERSION

# Push the Contour build image into the cluster.
kind::cluster::load::docker docker.io/projectcontour/contour:${VERSION}
kind::cluster::load::docker ghcr.io/projectcontour/contour:${VERSION}
fi


Expand All @@ -94,7 +94,7 @@ for file in ${REPO}/examples/contour/02-job-certgen.yaml ${REPO}/examples/contou
# Set the image tag to $VERSION to unambiguously use the image
# we built above.
run::sed \
"-es|image: docker.io/projectcontour/contour:.*$|image: docker.io/projectcontour/contour:${VERSION}|" \
"-es|image: ghcr.io/projectcontour/contour:.*$|image: ghcr.io/projectcontour/contour:${VERSION}|" \
"$file"

${KUBECTL} apply -f "$file"
Expand Down

0 comments on commit 08db655

Please sign in to comment.