go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.58k stars 994 forks source link

Bug/Feature Request, add lego back to $PATH of latest docker image '/bin/sh: lego: not found' #1992

Closed neoakris closed 11 months ago

neoakris commented 11 months ago

Welcome

What did you expect to see?

I do lots of PoC's (Proof of Concepts) / demo labs, and I came up with the below method of quickly and easily using the docker image of lego to imperatively provision wildcard HTTPS certs / manually doing the DNS challenge to avoid setting up credentials just to get a short lived cert for PoCs where I don't need the 3 month auto-renewal, because I'll tear down the PoC environment after 1 week.

https://gist.github.com/neoakris/8ce77dab88868de0f5206bc9c482cfab#step-2-provision-an-https-wildcard-cert-from-lets-encrypt

# [admin@workstation:~/traefik-lab]
mkdir -p ~/traefik-lab/cert
cd ~/traefik-lab/cert

docker run -it --entrypoint=/bin/sh --volume $HOME/traefik-lab/cert:/.lego/certificates   docker.io/goacme/lego:latest
# [shell@dockerized-ACME-client:/]
lego --email "your-email@your-domain.com" --domains="*.neoakris.dev" --dns "manual" run

I know the above worked March 20th, 2023. (I think I tested it a few months ago and it worked then as well)

What did you see instead?

Now when I try again I get an error about lego isn't found in the container's path environment variable

Note: It works fine with the absolute path: /lego --email "your-email@your-domain.com" --domains="*.neoakris.dev" --dns "manual" run

How do you use lego?

Docker image

Reproduction steps

I've run the following variations:
docker run -it --entrypoint=/bin/sh --volume $HOME/traefik-lab/cert:/.lego/certificates docker.io/goacme/lego:v4.10.0
docker run -it --entrypoint=/bin/sh --volume $HOME/traefik-lab/cert:/.lego/certificates docker.io/goacme/lego:v4.10.2

And found out that lego is found in the path of docker.io/goacme/lego:v4.10.0 (and older) Lego is not found in the path of docker.io/goacme/lego:v4.10.2 (and newer) (v4.10.1 doesn't seem to exist btw)

Version of lego

Lego version shouldn't matter  
but when the docker image changed from tag v4.10.0 --> v4.10.2  lego CLI stopped being found in the PATH variable.

Logs

NA

Go environment (if applicable)

NA

ldez commented 11 months ago

Hello,

The way to build our Docker image has been changed between v4.10.1 and v4.10.2. This change was a fix for the Docker image build failure of v4.10.1.

https://github.com/go-acme/lego/compare/v4.10.1...v4.10.2

As you said, the path has been changed you have to update your scripts.

neoakris commented 11 months ago

Thanks for confirming it's not a bug, but an update/intentional permanent change, I'll update my scripts/methodology notes.

I figured I'd report incase it was done accidentally and I wanted to verify it wasn't expected to change again.

ldez commented 11 months ago

No problem, it was not inside the changelog so I understand your question.