Skip to content

casperklein/docker-debian-repo

Repository files navigation

debian-repo

Version Supports amd64 architecture Supports aarch64 architecture Supports armhf architecture Supports armv7 architecture Docker image size

Docker image for running a Debian repository based on this wiki page.

Run a demo repository

# Passphrase for GPG key: insecure
docker run --rm -it -p 80:80 -v $PWD/repo-demo:/mnt:ro -e RELEASE=bookworm casperklein/debian-repo

Build Docker image (optional)

./build.sh

Create and serve repository

  1. Copy repo-demo

    cp -a repo-demo myrepo

  2. Create/Export new GPG key

    gpg --gen-key

    gpg -a -o myrepo/key.gpg --export-secret-keys <ID>

  3. Edit myrepo/distributions to your needs

    At least, you have to set SignWith to your GPG subkey ID

    gpg --list-secret-key --with-subkey-fingerprint # show subkey ID

    If you change "Codename", you have to adjust -e RELEASE= below accordingly.

  4. Serve repository via HTTP

    docker run --rm -it -p 80:80 -v $PWD/myrepo:/mnt:ro -e RELEASE=bookworm casperklein/debian-repo

Setup client

Import repository public key

wget -O - http://HOSTNAME/repos/apt/debian/repo.gpg | apt-key add -

Add repository to apt sources

echo "deb http://HOSTNAME/repos/apt/debian/ $(lsb_release -cs) main" >> /etc/apt/sources.list