Registry Reference
Jiji supports multiple container registry types for storing and distributing images.
Registry Types
Local Registry
Best for development and simple deployments. Runs on your local machine and is forwarded to servers via SSH tunnel.
builder:
registry:
type: local- Registry runs at
localhost:9270 - SSH reverse tunnel forwards to each server
- No authentication required
- Images stay on your network
GitHub Container Registry (GHCR)
builder:
registry:
type: remote
server: ghcr.io
username: your-github-username
password: GITHUB_TOKENImage naming: ghcr.io/username/project-service:version
Setup:
- Create a GitHub Personal Access Token with
write:packagesscope - Add
GITHUB_TOKEN=ghp_xxxto your.envfile
Docker Hub
builder:
registry:
type: remote
server: docker.io
username: your-dockerhub-username
password: DOCKER_TOKENImage naming: docker.io/username/project-service:version
Custom Registry
builder:
registry:
type: remote
server: registry.example.com
username: myuser
password: REGISTRY_PASSWORDImage Naming
Jiji automatically namespaces images based on registry type:
| Registry | Image Format |
|---|---|
| Local | localhost:9270/project-service:version |
| GHCR | ghcr.io/username/project-service:version |
| Docker Hub | docker.io/username/project-service:version |
| Custom | registry.example.com/project-service:version |
Registry Password
Never store credentials in config files. Use secret references:
builder:
registry:
password: GITHUB_TOKENWhen the password is an ALL_CAPS name like GITHUB_TOKEN, it will be resolved from your .env file. See the Secrets Configuration for details on how .env files work.
Registry Commands
Setup Registry
Configure registry on servers:
jiji registry setupFor remote registries, this authenticates each server with the registry.
Login
Manually authenticate with the registry:
jiji registry loginLogout
Remove registry credentials:
jiji registry logoutLocal Registry Details
How it works
- Local Docker registry runs on your machine at port 9270
jiji buildpushes images to local registryjiji deploycreates SSH tunnel from server to your machine- Server pulls image through the tunnel
- Tunnel closed after pull completes
Starting Local Registry
docker run -d -p 9270:5000 --name jiji-registry registry:2Or let Jiji manage it automatically.
Advantages
- No external registry needed
- Images never leave your network
- No authentication setup
- Fast for local development
Limitations
- Requires your machine to be accessible during deploy
- Not suitable for CI/CD pipelines
- Single point of failure
Remote Registry Authentication
Per-Environment Credentials
Use different secrets per environment with .env.{environment} files:
Staging (.env.staging):
GITHUB_TOKEN=ghp_staging_token_xxxProduction (.env.production):
GITHUB_TOKEN=ghp_production_token_xxxConfiguration (.jiji/deploy.yml):
builder:
registry:
type: remote
server: ghcr.io
username: myorg
password: GITHUB_TOKENDeploy with the appropriate environment:
jiji deploy -e staging # Uses .env.staging
jiji deploy -e production # Uses .env.productionCI/CD Setup
In your CI pipeline, set the token as an environment variable:
GitHub Actions:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}GitLab CI:
variables:
DOCKER_TOKEN: $CI_REGISTRY_PASSWORDTroubleshooting
401 Unauthorized
# Check secrets are configured
jiji secrets print
# Test login manually (reads from .env)
jiji registry login
# Or with host env fallback
jiji --host-env registry login403 Forbidden
- Verify token has
write:packagesscope (GHCR) - Check repository visibility settings
- Ensure username matches token owner
Push Failed
# Check local registry is running
docker ps | grep registry
# Check disk space
df -h
# Try manual push
docker push ghcr.io/username/project-service:latestPull Failed on Server
# Check server authentication
jiji server exec "docker login ghcr.io"
# Check network connectivity
jiji server exec "curl -I https://ghcr.io"
# For local registry, check SSH tunnel
jiji server exec "curl http://localhost:9270/v2/"