abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
768 stars 315 forks source link

Help with this wonderful image on Synology Diskstation #144

Closed bonny1992 closed 5 years ago

bonny1992 commented 5 years ago

Hello! I wanted to use this awesome image on a Synology's DSM machine, but had no luck. The latest version available for my sistem is the Docker version 1.6.2, build a263667, so I don't have the --build-arg functionality.

Since I need cloudflare dns plugin, I tried pulling the repo and editing the php/Dockerfile-no-stats file, but when I build the image it says INFO[0011] Tag builder as builder not found in repository abiosoft/caddy. I even tried pulling the images before then building with --pull=false but I didn't manage to make it work.

Can someone help me? Thank you in advance!

abiosoft commented 5 years ago

Unfortunately, I do not think there is any way out with regards to building an image from scratch, you need features only available in newer version of Docker.

However, I think you should be able to generate a binary with this. And copy the resulting binary to your docker container if you need to run it inside docker.

i.e. Generate with something like this to your server/linux machine.

docker run --rm -v $(pwd):/install \
    -e PLUGINS=cloudflare \
    -e ENABLE_TELEMETRY=false \
    abiosoft/caddy:builder

A Dockerfile like this should then be enough

FROM alpine
COPY ./caddy /bin/caddy
ENTRYPOINT ["/bin/caddy"]
bonny1992 commented 5 years ago

Thanks to your help, I managed to make a fully working Caddy image! (I had to install php into that, too) However, some of the plugins I needed made the build to fail, I understand that this is not your fault of course.

Just to be sure, will your image work on a arm64v8 device?

abiosoft commented 5 years ago

Since Go supports it as seen here, you should be able to generate a binary that works on an arm64 device.

But you cannot use this docker image since it is based on amd64.

abiosoft commented 5 years ago

I'll be closing this as this is not really an issue with the image.