Skip to content

Commit

Permalink
version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
casperklein committed Sep 18, 2021
1 parent 2a2a23b commit 37f5f41
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-weekly-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:10-slim as build
FROM debian:11-slim as build

ENV PACKAGES="apache2 reprepro"

Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,41 @@ 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

## 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 <ID>``
`gpg -a -o myrepo/key.gpg --export-secret-keys <ID>`

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 <ID> 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
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"user": "casperklein",
"name": "debian-repo",
"image": "casperklein/debian-repo",
"version": "0.2.0"
"version": "0.3.0"
}
2 changes: 1 addition & 1 deletion repo-demo/distributions
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions rootfs/run.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down

0 comments on commit 37f5f41

Please sign in to comment.