From 37f5f4140eb0d09445d79f500774c455dd8883fd Mon Sep 17 00:00:00 2001 From: casperklein Date: Sun, 19 Sep 2021 01:50:27 +0200 Subject: [PATCH] version 0.3.0 --- .github/workflows/build-weekly-all.yml | 2 +- CHANGELOG.md | 14 ++++++++++++++ Dockerfile | 2 +- README.md | 22 ++++++++++------------ config.json | 2 +- repo-demo/distributions | 2 +- rootfs/run.sh | 10 ++++++++-- 7 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/build-weekly-all.yml b/.github/workflows/build-weekly-all.yml index 15b2cfb..839d9de 100644 --- a/.github/workflows/build-weekly-all.yml +++ b/.github/workflows/build-weekly-all.yml @@ -37,7 +37,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1.5.1 + uses: docker/setup-buildx-action@v1.6.0 - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f57b016 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +## 0.3.0 + +- Base image updated to Debian 11 (Bullseye) +- RELEASE not hardcoded anymore. Now configurable via environment variable. + +## 0.2.0 + +- build improved + +## 0.1.1 + +- initial release diff --git a/Dockerfile b/Dockerfile index 46b96bd..76b5adf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10-slim as build +FROM debian:11-slim as build ENV PACKAGES="apache2 reprepro" diff --git a/README.md b/README.md index 3cf4909..84124c6 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,14 @@ Docker image for running a Debian repositority based on [this](https://wiki.debi ## Run repository demo # Passphrase for GPG key: insecure - docker run --rm -it -p 80:80 -v $PWD/repo-demo:/mnt:ro casperklein/debian-repo + docker run --rm -it -p 80:80 -v $PWD/repo-demo:/mnt:ro -e RELEASE=bullseye casperklein/debian-repo -## Setup repository on client: +## Setup repository on a 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 @@ -31,28 +31,26 @@ Add repository to apt sources ## Create own repository 1. Copy repo-demo - - ``cp -a repo-demo myrepo`` + + `cp -a repo-demo myrepo` 1. Create/Export new GPG key - ``gpg --gen-key`` + `gpg --gen-key` - ``gpg -a -o myrepo/key.gpg --export-secret-keys `` + `gpg -a -o myrepo/key.gpg --export-secret-keys ` 1. Edit *myrepo/distributions* to your needs At least, you have to set *SignWith* to your GPG subkey ID - ``gpg --fingerprint --fingerprint # show subkey ID (remove spaces)`` - - or + `gpg --list-secret-key --with-subkey-fingerprint # show subkey ID` - ``gpg --edit-key quit`` + If you change "Codename", you have to adjust `-e RELEASE=` below accordingly. 1. Run own repository - ``docker run --rm -it -p 80:80 -v $PWD/myrepo:/mnt:ro casperklein/debian-repo`` + `docker run --rm -it -p 80:80 -v $PWD/myrepo:/mnt:ro -e RELEASE=bullseye casperklein/debian-repo` [aarch64-shield]: https://img.shields.io/badge/aarch64-yes-blue.svg [amd64-shield]: https://img.shields.io/badge/amd64-yes-blue.svg diff --git a/config.json b/config.json index 7cc7e73..15a4b7e 100644 --- a/config.json +++ b/config.json @@ -2,5 +2,5 @@ "user": "casperklein", "name": "debian-repo", "image": "casperklein/debian-repo", - "version": "0.2.0" + "version": "0.3.0" } diff --git a/repo-demo/distributions b/repo-demo/distributions index a9d1393..59f137e 100644 --- a/repo-demo/distributions +++ b/repo-demo/distributions @@ -1,6 +1,6 @@ Origin: Repo Demo Label: Repo Demo -Codename: buster +Codename: bullseye Architectures: amd64 Components: main Description: Apt repository with a dummy package diff --git a/rootfs/run.sh b/rootfs/run.sh index 05ab2af..b3d7680 100755 --- a/rootfs/run.sh +++ b/rootfs/run.sh @@ -1,5 +1,11 @@ #!/bin/bash +if [ -z "$RELEASE" ]; then + echo "Error: RELEASE not set." + echo + exit 1 +fi >&2 + set -ueo pipefail # import gpg key @@ -14,13 +20,13 @@ cp /mnt/distributions conf/ gpg -a --export -o repo.gpg # import packages -reprepro includedeb buster /mnt/*.deb +reprepro includedeb "$RELEASE" /mnt/*.deb kill $(pidof gpg-agent) echo echo echo 'Serving packages:' -reprepro list buster +reprepro list "$RELEASE" echo echo