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
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.
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
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically