This allows you to run GPG commands using your host machine's ~/.ssh
and ~/.gnupg
directories.
In the Makefile there are commands for both building and pushing the image to DockerHub.
# Builds an image named 'stevenaldinger/docker-gpg:latest'
make build \
dockerhub_user='stevenaldinger' \
version="latest"
# Pushes an image to 'stevenaldinger/docker-gpg:latest'
make push \
dockerhub_user='stevenaldinger' \
version="latest"
In general, when you run this docker image it will make sure the GPG agent is running and then it will run any command you pass in.
cd
into the directory you want to export keys to.- Then run the container as a daemon:
docker run --rm --name gpg \
-v "$HOME/.ssh":/root/.ssh \
-v "$(pwd)/gnupg":/gnupg/USBDrive/gnupg \
-d stevenaldinger/docker-gpg:latest \
tail -f /dev/null
The docker-compose.yml configuration runs tail -f /dev/null
inside the container to keep it running and then the example files can be used to execute gpg
commands inside the container.
Run make run
to run a stevenaldinger/docker-gpg:latest
container named gpg
.
Run make keys
with your desired email and name.
make keys \
email=drone@grinsides.com \
name='Drone Server'
Run make keys_anon
to generated anonymous credentials.
make get_key \
email=drone@grinsides.com
make down