Caddy ssh Docker container

Hi, I have Caddy installed in a Docker container. I want to change file in that container, but I can’t ssh into. I tried docker exec -it <container name> /bin/bash, but it didn’t work. I am getting this error: starting container process caused: exec: “/bin/bash”: stat /bin/bash: no such file or directory: unknown.

when I do docker inspect 80372bc2c41e

“Cmd”: [
“caddy”,
“run”,
“–config”,
“/etc/caddy/Caddyfile”,
“–adapter”,
“caddyfile”
],

I don’t see /bin/bash.

Any idea how to ssh in the container?

Use /bin/sh. The alpine base image doesn’t come with bash.

Or you can extend the Caddy image with a Dockerfile to run apk add --no-cache bash to add it.

But really, you probably shouldn’t need to get a shell into the container. You should use volumes to get the relevant files into the container, and reload Caddy using the method documented on Docker Hub.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.