FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.95k stars 482 forks source link

Add Docker image #315

Closed jauderho closed 2 years ago

jauderho commented 2 years ago

Add option to use Docker image.

Source Dockerfile is here: https://github.com/jauderho/dockerfiles/blob/main/age/Dockerfile

Supported variants: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6, linux/ppc64le

Images will be built whenever you tag a new release. HTH.

alerque commented 2 years ago

I appreciate the contribution, but some details of this make me a little bit uncomfortable. I do not expect to have a use myself for a dockerized version of age (preferring distro packages where possible) except possibly in GH Actions before packages are available in the LTS images used — so this is me projecting on what I would look for if I was going to use one.

  1. It would be nice to have this hosted somewhere more official. This repository itself gets a huge amount of scrutiny, so hosting it in-repo is one possibility. That would enable people to build their own containers from any version (tagged or HEAD) more easily too.
    • On the downside the release cadence may not always be a match.
    • On the plus site putting it in repository would enable this repository to be used as a GitHub Action. Images could be built in Actions and placed in GHCR and an action file here would enable use as a docker container as a step in other actions. I've set this up for other projects and would by happy to submit it here if desired.
  2. The Dockerfile itself is just a bit convoluted. Since you are using a throw-away container to build anyway, trying to do everything in one command string rather than separate RUN steps/layers is harder to debug and watch.
  3. Wherever the source is kept and published the container meta data and publish location should probably be an official org namespace.
FiloSottile commented 2 years ago

Thank you for building this! Generally, I prefer not to list unofficial (in the sense they are not maintained by the package manager authors or myself) installs in the README. I personally find Dockerizing individual CLI tools too granular, so I'll probably leave to each user figuring out what the right Docker setup is for them.

jauderho commented 2 years ago

No worries. I'm happy to contribute using GH action to build the image as part of the repo. I've done this for drwetter's testssl.sh.

See https://github.com/drwetter/testssl.sh/blob/3.1dev/.github/workflows/docker-3.1dev.yml

You would need to add Docker credentials to secrets if you want to push to Docker Hub though which is why drwetter's setup is only pushing to GHCR for now.