Skip to content

Run in docker

neil edited this page Nov 2, 2021 · 15 revisions
Clone this wiki locally 💕 docker

As one of the big docker fans, I understand that we hate installing anything on a docker host, even if it's just copying a shell script.

Automated nginx reverse proxy docker image with for letsencrypt ssl cert:

Deploy to a docker container and reload it:

So, Here " in docker" comes.

  1. Based on alpine, only 5MB size.
  2. Either run as executable or run as daemon
  3. Support all the command line parameters.

1. Say "Hello World"

docker run --rm neilpang/

2. Used as an executable:

docker run --rm  -it  \
  -v "$(pwd)/out":/  \
  --net=host \
  neilpang/  --issue -d  --standalone

You can use any commands that supports here, other examples:

#revoke a cert
docker run --rm  -it  \
  -v "$(pwd)/out":/  \
  --net=host \
  neilpang/  --revoke -d
#use dns mode
docker run --rm  -it  \
  -v "$(pwd)/out":/  \
  neilpang/  --issue --dns -d
#run cron job
docker run --rm  -it  \
  -v "$(pwd)/out":/  \
  --net=host \
  neilpang/  --cron

Anyway, you can just invoke neilpang/ image as if it were a real shell script.

3. Run as a docker daemon.

1. Running as a docker daemon, so that it can handle the renewal cronjob automatically.

docker run --rm  -itd  \
  -v "$(pwd)/out":/  \
  --net=host \ \
  neilpang/ daemon

2. Then you can just use docker exec to execute any commands.

docker  exec --help
docker  exec --issue -d  --standalone

Yes, again, You can use any commands that supports here.