cog push to deploy your models.
Usage
Authentication Methods
Replicate Registry (r8.im)
For Replicate’s registry,cog login uses a token-based authentication flow:
Other Registries
For Docker Hub, GitHub Container Registry, AWS ECR, and other registries,cog login prompts for username and password:
Examples
Login to Replicate
Interactive login that opens your browser:Login with token from stdin
Useful for CI/CD pipelines:Login in CI/CD
GitHub Actions example:.github/workflows/deploy.yml
Login to Docker Hub
Registry Configuration
By default,cog login authenticates with Replicate’s registry (r8.im). To use a different registry:
Supported Registries
Cog works with any Docker-compatible container registry:- Replicate (
r8.im) - Token-based authentication - Docker Hub (
docker.io) - Username/password - GitHub Container Registry (
ghcr.io) - Personal access token - AWS ECR - AWS credentials
- Google Container Registry (
gcr.io) - Service account - Azure Container Registry - Service principal
- Private registries - Username/password or token
For cloud provider registries (AWS ECR, GCR, ACR), you may need to use their CLI tools to authenticate first, then Cog will use those credentials automatically.
Options
| Flag | Description |
|---|---|
--token-stdin | Pass login token on stdin instead of opening a browser |
--registry string | Registry host to authenticate with (default: r8.im) |
-h, --help | Show help for the login command |
Security Best Practices
Store tokens securely
Never commit tokens to version control:Use CI/CD secrets
Store tokens in your CI/CD platform’s secret management:- GitHub Actions: Repository secrets
- GitLab CI: CI/CD variables
- CircleCI: Environment variables
- Travis CI: Encrypted environment variables
Rotate tokens regularly
Generate new authentication tokens periodically and update your CI/CD secrets.Troubleshooting
Authentication failed
If login fails, verify:- Your token or credentials are correct
- You have network connectivity to the registry
- The registry URL is correct
Docker not found
Cog uses Docker’s credential system. Make sure Docker is installed:Permission denied
On Linux, you may need to add your user to thedocker group: