Client Configuration
Configure your package managers and build tools to use Artifact Keeper as your artifact registry.
Docker
Login
docker login registry.example.comUsername: alicePassword: [your-password-or-token]Pull Image
docker pull registry.example.com/my-docker-repo/my-app:1.2.3Push Image
# Tag imagedocker tag my-app:1.2.3 registry.example.com/my-docker-repo/my-app:1.2.3
# Pushdocker push registry.example.com/my-docker-repo/my-app:1.2.3Configuration File
~/.docker/config.json:
{ "auths": { "registry.example.com": { "auth": "base64-encoded-username:password" } }}Maven
settings.xml
Add to ~/.m2/settings.xml:
<settings> <servers> <server> <id>artifact-keeper</id> <username>alice</username> <password>your-password-or-token</password> </server> </servers>
<mirrors> <mirror> <id>artifact-keeper</id> <name>Artifact Keeper</name> <url>https://registry.example.com/maven2/my-maven-repo</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
<profiles> <profile> <id>artifact-keeper</id> <repositories> <repository> <id>artifact-keeper</id> <url>https://registry.example.com/maven2/my-maven-repo</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles>
<activeProfiles> <activeProfile>artifact-keeper</activeProfile> </activeProfiles></settings>pom.xml
For publishing:
<distributionManagement> <repository> <id>artifact-keeper</id> <url>https://registry.example.com/maven2/my-maven-repo</url> </repository> <snapshotRepository> <id>artifact-keeper</id> <url>https://registry.example.com/maven2/my-maven-snapshots</url> </snapshotRepository></distributionManagement>Deploy
mvn clean deploynpm
Login
npm login --registry=https://registry.example.com/npm/my-npm-repo.npmrc
Project-level (.npmrc in project root):
registry=https://registry.example.com/npm/my-npm-repo///registry.example.com/npm/my-npm-repo/:_authToken=your-api-tokenUser-level (~/.npmrc):
registry=https://registry.example.com/npm/my-npm-repo///registry.example.com/npm/my-npm-repo/:_authToken=your-api-tokenScope-specific Registry
For scoped packages:
@mycompany:registry=https://registry.example.com/npm/my-npm-repo///registry.example.com/npm/my-npm-repo/:_authToken=your-api-tokenInstall Package
npm install my-package@1.2.3Publish Package
npm publishpip (Python)
pip.conf
Linux/macOS (~/.pip/pip.conf):
[global]index-url = https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simpleWindows (%APPDATA%\pip\pip.ini):
[global]index-url = https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simpleCommand Line
pip install --index-url https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simple my-packagerequirements.txt
--index-url https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simplemy-package==1.2.3Publish with twine
twine upload --repository-url https://registry.example.com/pypi/my-pypi-repo/ \ --username alice \ --password your-token \ dist/*Cargo (Rust)
.cargo/config.toml
Project-level or user-level (~/.cargo/config.toml):
[registries.artifact-keeper]index = "https://registry.example.com/crates/my-crates-repo/index"
[net]git-fetch-with-cli = true
[source.artifact-keeper]registry = "https://registry.example.com/crates/my-crates-repo"
[source.crates-io]replace-with = "artifact-keeper"Cargo.toml
For publishing:
[package]name = "my-package"version = "1.2.3"publish = ["artifact-keeper"]Login
cargo login --registry=artifact-keeper your-api-tokenPublish
cargo publish --registry=artifact-keeperHelm
Add Repository
helm repo add my-helm-repo https://registry.example.com/helm/my-helm-repo \ --username alice \ --password your-tokenUpdate Repositories
helm repo updateInstall Chart
helm install my-release my-helm-repo/my-chartPush Chart
Using helm-push plugin:
# Install pluginhelm plugin install https://github.com/chartmuseum/helm-push
# Push charthelm cm-push my-chart-1.2.3.tgz my-helm-repoGo
GOPROXY
Set environment variable:
export GOPROXY=https://alice:your-token@registry.example.com/go/my-go-repo,directOr in ~/.bashrc / ~/.zshrc:
export GOPROXY="https://alice:your-token@registry.example.com/go/my-go-repo,direct".netrc for Authentication
~/.netrc:
machine registry.example.comlogin alicepassword your-tokenSet permissions:
chmod 600 ~/.netrcgo.mod
module github.com/mycompany/my-module
go 1.21
require ( github.com/mycompany/my-package v1.2.3)Install Dependencies
go mod downloadNuGet (.NET)
nuget.config
Project-level or user-level:
<?xml version="1.0" encoding="utf-8"?><configuration> <packageSources> <clear /> <add key="artifact-keeper" value="https://registry.example.com/nuget/my-nuget-repo/v3/index.json" /> </packageSources> <packageSourceCredentials> <artifact-keeper> <add key="Username" value="alice" /> <add key="ClearTextPassword" value="your-token" /> </artifact-keeper> </packageSourceCredentials></configuration>Add Source
dotnet nuget add source https://registry.example.com/nuget/my-nuget-repo/v3/index.json \ --name artifact-keeper \ --username alice \ --password your-token \ --store-password-in-clear-textInstall Package
dotnet add package MyPackage --version 1.2.3Publish Package
dotnet nuget push MyPackage.1.2.3.nupkg \ --source https://registry.example.com/nuget/my-nuget-repo \ --api-key your-tokenRubyGems
Add Source
gem sources --add https://registry.example.com/rubygems/my-gems-repo/List Sources
gem sources --list.gemrc
~/.gemrc:
---:sources: - https://registry.example.com/rubygems/my-gems-repo/:backtrace: false:bulk_threshold: 1000:update_sources: true:verbose: trueBundler
Gemfile:
source 'https://registry.example.com/rubygems/my-gems-repo/'
gem 'my-gem', '~> 1.2.3'Authentication
Add credentials to ~/.gem/credentials:
---:artifact_keeper: your-api-tokenOr use environment variable:
export GEM_HOST_API_KEY=your-api-tokenPublish Gem
gem push my-gem-1.2.3.gem --host https://registry.example.com/rubygems/my-gems-repo/Composer (PHP)
composer.json
{ "repositories": [ { "type": "composer", "url": "https://registry.example.com/composer/my-composer-repo" } ], "require": { "myvendor/my-package": "1.2.3" }, "config": { "secure-http": true }}Authentication
Using auth.json:
{ "http-basic": { "registry.example.com": { "username": "alice", "password": "your-token" } }}Or via command:
composer config http-basic.registry.example.com alice your-tokenInstall Dependencies
composer installGradle
build.gradle (Groovy)
repositories { maven { url "https://registry.example.com/maven2/my-maven-repo" credentials { username = "alice" password = "your-token" } }}
publishing { publications { maven(MavenPublication) { from components.java } } repositories { maven { url = "https://registry.example.com/maven2/my-maven-repo" credentials { username = "alice" password = "your-token" } } }}build.gradle.kts (Kotlin)
repositories { maven { url = uri("https://registry.example.com/maven2/my-maven-repo") credentials { username = "alice" password = "your-token" } }}
publishing { publications { create<MavenPublication>("maven") { from(components["java"]) } } repositories { maven { url = uri("https://registry.example.com/maven2/my-maven-repo") credentials { username = "alice" password = "your-token" } } }}gradle.properties
Store credentials securely:
artifactKeeperUsername=aliceartifactKeeperPassword=your-tokenReference in build.gradle:
credentials { username = project.findProperty("artifactKeeperUsername") ?: "" password = project.findProperty("artifactKeeperPassword") ?: ""}Conda
.condarc
~/.condarc:
channels: - https://alice:your-token@registry.example.com/conda/my-conda-repo - defaults
ssl_verify: trueInstall Package
conda install -c https://alice:your-token@registry.example.com/conda/my-conda-repo my-packageAPI Token Management
For all package managers, use API tokens instead of passwords:
Generate Token
curl -X POST https://registry.example.com/api/v1/users/me/tokens \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "CI Pipeline Token", "scopes": ["repository:read", "repository:write"], "expires_at": "2027-12-31T23:59:59Z" }'List Tokens
curl https://registry.example.com/api/v1/users/me/tokens \ -H "Authorization: Bearer $ACCESS_TOKEN"Revoke Token
curl -X DELETE https://registry.example.com/api/v1/users/me/tokens/token-123 \ -H "Authorization: Bearer $ACCESS_TOKEN"CI/CD Integration
GitHub Actions
- name: Configure npm run: | echo "//registry.example.com/npm/my-npm-repo/:_authToken=${{ secrets.ARTIFACT_KEEPER_TOKEN }}" > ~/.npmrc
- name: Publish package run: npm publishGitLab CI
before_script: - echo "//registry.example.com/npm/my-npm-repo/:_authToken=${ARTIFACT_KEEPER_TOKEN}" > ~/.npmrc
publish: script: - npm publishJenkins
withCredentials([string(credentialsId: 'artifact-keeper-token', variable: 'TOKEN')]) { sh 'echo "//registry.example.com/npm/my-npm-repo/:_authToken=${TOKEN}" > ~/.npmrc' sh 'npm publish'}Troubleshooting
Authentication Failures
Verify credentials:
curl -u alice:your-token https://registry.example.com/api/v1/healthCheck token hasn’t expired:
curl https://registry.example.com/api/v1/users/me/tokens \ -H "Authorization: Bearer $ACCESS_TOKEN"SSL Certificate Issues
Trust custom CA certificate:
# Download CA certcurl https://registry.example.com/ca.crt -o /usr/local/share/ca-certificates/artifact-keeper.crt
# Update CA bundlesudo update-ca-certificatesFor npm:
npm config set cafile /path/to/ca.crtNetwork/Proxy Issues
Configure HTTP proxy:
export HTTP_PROXY=http://proxy.example.com:8080export HTTPS_PROXY=http://proxy.example.com:8080For npm:
npm config set proxy http://proxy.example.com:8080npm config set https-proxy http://proxy.example.com:8080