Files
slipmatz-web/GHCR-AUTH.md
2025-11-27 00:12:35 +08:00

1.3 KiB

Login to GitHub Container Registry (GHCR)

On the Server

1. Create GitHub Personal Access Token

Go to: https://github.com/settings/tokens

Click "Generate new token (classic)"

Select scopes:

  • read:packages (required)
  • write:packages (if you need to push)

Copy the token (starts with ghp_)

2. Login to GHCR

# On your server
echo YOUR_GITHUB_TOKEN | docker login ghcr.io -u franknstayn --password-stdin

Or export as environment variable:

export GITHUB_TOKEN=ghp_your_token_here
echo $GITHUB_TOKEN | docker login ghcr.io -u franknstayn --password-stdin

3. Pull the image

cd crew-infrastructure
docker compose pull slipmatz_web
docker compose up -d slipmatz_web

Make Package Public (Alternative - No Auth Required)

If you want to avoid authentication:

  1. Go to: https://github.com/franknstayn?tab=packages
  2. Click on slipmatz-web package
  3. Package settings (right sidebar)
  4. "Change visibility" → Select "Public"
  5. Confirm

Then you can pull without login:

docker compose pull slipmatz_web

Store credentials securely:

# On server, add to ~/.bashrc or ~/.zshrc
export GITHUB_TOKEN=ghp_your_token_here

# Add to docker-compose.yml env
echo "GITHUB_TOKEN=$GITHUB_TOKEN" >> .env

Or use docker credential helper for permanent storage.