Skip to main content

Run BaGetter on Docker

Configure BaGetter (optional)

Create a file named bagetter.env to store BaGetter's configurations:

# The following config is the API Key used to publish packages.
# You should change this to a secret value to secure your server.
ApiKey=NUGET-SERVER-API-KEY

Storage__Type=FileSystem
Storage__Path=/data
Database__Type=Sqlite
Database__ConnectionString=Data Source=/data/db/bagetter.db
Search__Type=Database

For a full list of configurations, please refer to BaGetter's configuration guide.

info

The bagetter.env file stores BaGetter's configuration as environment variables. To learn how these configurations work, please refer to ASP.NET Core's configuration documentation.

If this step is omitted the default mode (unconfigured) will be Sqlite with the sql blobs stored in the path /data/db/bagetter.db.

Run BaGetter

  1. Create a folder named bagetter-data in the same directory as the bagetter.env file. This will be used by BaGetter to persist its state.
  2. Pull BaGetter's latest docker image:
docker pull bagetter/bagetter

You can now run BaGetter...

  • ...with optional .env file:
docker run --rm --name nuget-server -p 5000:8080 --env-file bagetter.env -v "$(pwd)/bagetter-data:/data" bagetter/bagetter:latest
  • ...or without:
docker run --rm --name nuget-server -p 5000:8080 -v "$(pwd)/bagetter-data:/data" bagetter/bagetter:latest

Publish packages

Publish your first package with:

dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY package.1.0.0.nupkg

Publish your first symbol package with:

dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY symbol.package.1.0.0.snupkg
warning

The default API Key to publish packages is NUGET-SERVER-API-KEY. You should change this to a secret value to secure your server. See Configure BaGetter.

Browse packages

You can browse packages by opening the URL http://localhost:5000/ in your browser.

Restore packages

You can restore packages by using the following package source:

http://localhost:5000/v3/index.json

Some helpful guides:

Symbol server

You can load symbols by using the following symbol location:

http://localhost:5000/api/download/symbols

For Visual Studio, please refer to the Configure Debugging guide.