caddyserver / caddy-docker

Source for the official Caddy v2 Docker Image
https://hub.docker.com/_/caddy
Apache License 2.0
423 stars 75 forks source link

[help] How to properly write a custom image #249

Closed ghost closed 2 years ago

ghost commented 2 years ago

I am using the docker image caddy/caddy:2.5.1-alpine and it is working great ! thank you so much.

Now I want to add fail2ban into the cocktail, could you please help me achieve this ?

I'm afraid something simple like

FROM caddy/caddy:2.5.1-alpine
# something like https://github.com/crazy-max/docker-fail2ban/blob/master/Dockerfile
RUN tar xvjf fail2ban-x.x.x.tar.bz2
...

Would not be sufficient or corrupt.

Thanks a lot

trmatthe commented 2 years ago

@bacloud22 You could use the docker ADD directive which understands compressed formats. If your compressed tar is local then ADD will expand it https://docs.docker.com/engine/reference/builder/#add

You will still need to ensure whatever post-install setup actions required by fail2ban are executed though.

ghost commented 2 years ago

Hello @trmatthe I tried xcaddy image and added a plugin. It works great! So I think I don't really need fail2ban at least now. Thanks a lot for directives.

francislavoie commented 2 years ago

Don't use caddy/caddy, please use caddy.

The former is our CI build target, it's not the actual official image.

ghost commented 2 years ago

Thanks @francislavoie Now I'm using

caddy:2.5.2-builder-alpine And caddy:2.5.2-alpine

Thanks