Skip to content

Client Configuration

Configure your package managers and build tools to use Artifact Keeper as your artifact registry.

Docker

Login

Terminal window
docker login registry.example.com
Username: alice
Password: [your-password-or-token]

Pull Image

Terminal window
docker pull registry.example.com/my-docker-repo/my-app:1.2.3

Push Image

Terminal window
# Tag image
docker tag my-app:1.2.3 registry.example.com/my-docker-repo/my-app:1.2.3
# Push
docker push registry.example.com/my-docker-repo/my-app:1.2.3

Configuration 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

Terminal window
mvn clean deploy

npm

Login

Terminal window
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-token

User-level (~/.npmrc):

registry=https://registry.example.com/npm/my-npm-repo/
//registry.example.com/npm/my-npm-repo/:_authToken=your-api-token

Scope-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-token

Install Package

Terminal window
npm install my-package@1.2.3

Publish Package

Terminal window
npm publish

pip (Python)

pip.conf

Linux/macOS (~/.pip/pip.conf):

[global]
index-url = https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simple

Windows (%APPDATA%\pip\pip.ini):

[global]
index-url = https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simple

Command Line

Terminal window
pip install --index-url https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simple my-package

requirements.txt

--index-url https://alice:your-token@registry.example.com/pypi/my-pypi-repo/simple
my-package==1.2.3

Publish with twine

Terminal window
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

Terminal window
cargo login --registry=artifact-keeper your-api-token

Publish

Terminal window
cargo publish --registry=artifact-keeper

Helm

Add Repository

Terminal window
helm repo add my-helm-repo https://registry.example.com/helm/my-helm-repo \
--username alice \
--password your-token

Update Repositories

Terminal window
helm repo update

Install Chart

Terminal window
helm install my-release my-helm-repo/my-chart

Push Chart

Using helm-push plugin:

Terminal window
# Install plugin
helm plugin install https://github.com/chartmuseum/helm-push
# Push chart
helm cm-push my-chart-1.2.3.tgz my-helm-repo

Go

GOPROXY

Set environment variable:

Terminal window
export GOPROXY=https://alice:your-token@registry.example.com/go/my-go-repo,direct

Or in ~/.bashrc / ~/.zshrc:

Terminal window
export GOPROXY="https://alice:your-token@registry.example.com/go/my-go-repo,direct"

.netrc for Authentication

~/.netrc:

machine registry.example.com
login alice
password your-token

Set permissions:

Terminal window
chmod 600 ~/.netrc

go.mod

module github.com/mycompany/my-module
go 1.21
require (
github.com/mycompany/my-package v1.2.3
)

Install Dependencies

Terminal window
go mod download

NuGet (.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

Terminal window
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-text

Install Package

Terminal window
dotnet add package MyPackage --version 1.2.3

Publish Package

Terminal window
dotnet nuget push MyPackage.1.2.3.nupkg \
--source https://registry.example.com/nuget/my-nuget-repo \
--api-key your-token

RubyGems

Add Source

Terminal window
gem sources --add https://registry.example.com/rubygems/my-gems-repo/

List Sources

Terminal window
gem sources --list

.gemrc

~/.gemrc:

---
:sources:
- https://registry.example.com/rubygems/my-gems-repo/
:backtrace: false
:bulk_threshold: 1000
:update_sources: true
:verbose: true

Bundler

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-token

Or use environment variable:

Terminal window
export GEM_HOST_API_KEY=your-api-token

Publish Gem

Terminal window
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:

Terminal window
composer config http-basic.registry.example.com alice your-token

Install Dependencies

Terminal window
composer install

Gradle

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=alice
artifactKeeperPassword=your-token

Reference 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: true

Install Package

Terminal window
conda install -c https://alice:your-token@registry.example.com/conda/my-conda-repo my-package

API Token Management

For all package managers, use API tokens instead of passwords:

Generate Token

Terminal window
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

Terminal window
curl https://registry.example.com/api/v1/users/me/tokens \
-H "Authorization: Bearer $ACCESS_TOKEN"

Revoke Token

Terminal window
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 publish

GitLab CI

before_script:
- echo "//registry.example.com/npm/my-npm-repo/:_authToken=${ARTIFACT_KEEPER_TOKEN}" > ~/.npmrc
publish:
script:
- npm publish

Jenkins

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:

Terminal window
curl -u alice:your-token https://registry.example.com/api/v1/health

Check token hasn’t expired:

Terminal window
curl https://registry.example.com/api/v1/users/me/tokens \
-H "Authorization: Bearer $ACCESS_TOKEN"

SSL Certificate Issues

Trust custom CA certificate:

Terminal window
# Download CA cert
curl https://registry.example.com/ca.crt -o /usr/local/share/ca-certificates/artifact-keeper.crt
# Update CA bundle
sudo update-ca-certificates

For npm:

Terminal window
npm config set cafile /path/to/ca.crt

Network/Proxy Issues

Configure HTTP proxy:

Terminal window
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080

For npm:

Terminal window
npm config set proxy http://proxy.example.com:8080
npm config set https-proxy http://proxy.example.com:8080