Why does my Docker container exit with error code 1 when using an image from GitHub Container Registry?

0
4
Asked By CraftyWombat27 On

I just pushed a new Docker container to the GitHub Container Registry, but I'm running into an issue. When I clone the repo and run `docker compose up` using the following compose file, everything works perfectly:

```yml
services:
dragon-dns:
build: .
container_name: ddns
environment:
- CLOUDFLARE_API_TOKEN=nothere
- MACHINE_ID=1
- LOG_LEVEL=trace
- CACHE_EXPIRATION=1m
```

However, when I change `build: .` to `image: ghcr.io/zinix-org/dragon-dns:main`, the container exits immediately with error code 1. I even tried starting it with an interactive shell to run ddns manually, but I get the same result. Any ideas on what's going wrong?

2 Answers

Answered By BakingFrogs5 On

I had a similar problem before! Sometimes when switching from `build` to `image`, you might forget to include all dependencies or settings that were there in your Dockerfile. Make sure that your Dockerfile is set up correctly and that it’s pushing everything needed. It might be worth testing with a different tag or even rebuilding the image just to be safe.

Answered By DockerNinja88 On

It sounds like there might be an issue with how the image is built or configured. When you use `image: ghcr.io/zinix-org/dragon-dns:main`, double-check that the necessary environment variables are being passed correctly. Sometimes, the error could be due to a missing configuration or dependency that works fine when you build locally but not in the pushed image. Also, try running `docker logs ` to get more details on the exit reason.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.