Skip to content

Commit b0fd597

Browse files
fix: switch Docker registry from Docker Hub to GHCR to fix push authorization failure
The Docker Hub push failed with 'insufficient_scope: authorization failed'. Switch to GitHub Container Registry (GHCR) which uses the built-in GITHUB_TOKEN and requires no external secrets configuration. - Use ghcr.io registry with GITHUB_TOKEN authentication - Add packages:write permission to workflow - Update compose.yaml image reference to GHCR Agent-Logs-Url: https://github.com/Baker-link-Lab/bakerlink_tutorial_template/sessions/b218a431-c3b4-484b-a1f5-9de7fc7ec76b Co-authored-by: Baker-Tanaka <42606588+Baker-Tanaka@users.noreply.github.com>
1 parent 82ed949 commit b0fd597

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.docker/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
{{project-name}}:
3-
image: "bakerlinklab/bakerlink-env:latest"
3+
image: "ghcr.io/baker-link-lab/bakerlink-env:latest"
44
container_name: "{{project-name}}-container"
55
volumes:
66
- "../:/{{project-name}}"

.github/workflows/docker-publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
DOCKER_IMAGE: bakerlinklab/bakerlink-env
11+
REGISTRY: ghcr.io
12+
DOCKER_IMAGE: ghcr.io/baker-link-lab/bakerlink-env
1213

1314
jobs:
1415
build-and-push:
1516
runs-on: ubuntu-latest
1617
permissions:
1718
contents: read
19+
packages: write
1820
steps:
1921
- name: Checkout
2022
uses: actions/checkout@v4
2123

2224
- name: Set up Docker Buildx
2325
uses: docker/setup-buildx-action@v3
2426

25-
- name: Login to Docker Hub
26-
# Requires repository secrets: DOCKERHUB_USERNAME and DOCKERHUB_TOKEN
27+
- name: Login to GitHub Container Registry
2728
uses: docker/login-action@v3
2829
with:
29-
username: ${{ secrets.DOCKERHUB_USERNAME }}
30-
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
3133

3234
- name: Build and push
3335
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)