Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build my own image with a custom Caddyfile #214

Open
ighormartins opened this issue Aug 16, 2019 · 2 comments
Open

How to build my own image with a custom Caddyfile #214

ighormartins opened this issue Aug 16, 2019 · 2 comments

Comments

@ighormartins
Copy link

ighormartins commented Aug 16, 2019

I need to build and export an image with a custom Caddyfile inside it.

I tried something as simple as:

FROM abiosoft/caddy:latest

COPY Caddyfile /etc/Caddyfile

However, the container is always restarting and the server won't start.

@abiosoft
Copy link
Owner

Can you share the error log?

Also you can temporarily RUN cat /etc/Caddyfile in the build process to be sure the copy was successful.

@ighormartins
Copy link
Author

ighormartins commented Aug 17, 2019

Of course
It goes all fine while building the image:

Status: Downloaded newer image for abiosoft/caddy:latest
 ---> f2eece677796
Step 2/4 : COPY Caddyfile /etc/Caddyfile
 ---> 7c336a0c0ec4
Step 3/4 : RUN cat /etc/Caddyfile
 ---> Running in 5ade95d29a7e
the.url {
    proxy / graphql-engine:8080 {
        websocket
    }
}

Then, that's what I have in my docker-compose:

caddy:
    image: the-image-I-built:latest
    depends_on:
      - "graphql-engine"
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - caddy_certs:/root/.caddy

But then the container is always restarting:

CONTAINER ID        IMAGE                                                                   COMMAND                  CREATED             STATUS                         PORTS               NAMES
25249e479c1a        the-image-I-built:latest    "/bin/parent caddy /…"   36 seconds ago      Restarting (1) 2 seconds ago                       root_caddy_1

And here is the docker logs:

2019/08/17 09:43:37 args:2 - Error during parsing: Unknown directive '/bin/sh'
exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants