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

Don't hide Traefik errors #414

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Don't hide Traefik errors #414

merged 1 commit into from
Aug 15, 2023

Conversation

djmb
Copy link
Collaborator

@djmb djmb commented Aug 8, 2023

When stopping or starting Traefik, don't hide important errors.

Docker doesn't return an error when starting a started container or stopping a stopped container.

When rebooting we want to know about errors during run as we've just stopped and removed the previous container.

When booting, we want to leave the running container if it exists, restart a stopped container and run a new one if it doesn't.

We can implement this with docker start ... || docker run ...:

  • if the container is started, docker start will exit with 0
  • if the container is stopped, docker start will start and exit with 0
  • if the container doesn't exist, docker start will return a non zero exit code and docker run will create a new container. Any errors in docker run will be returned

When stopping or starting Traefik, don't hide important errors.

Docker doesn't return an error when starting a started container or
stopping a stopped container.

When rebooting we want to know about errors during run as we've just
stopped and removed the previous container.

When booting, we want to leave the running container if it exists,
restart a stopped container and run a new one if none exists.

We can implement this with `docker start ... || docker run ...`:
- if the container is started, `docker start` will exit with 0
- if the container is stopped, `docker start` will start it and exit with 0
- if the container doesn't exist, `docker start` will return a non zero
exit code and `docker run` will create a new container. Any errors in
`docker run` will be returned.
@djmb
Copy link
Collaborator Author

djmb commented Aug 8, 2023

Fixes #411 and #217

@djmb djmb merged commit dda7099 into main Aug 15, 2023
6 checks passed
@jeremy jeremy deleted the traefik-start-stop-run-errors branch September 6, 2023 21:25
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

Successfully merging this pull request may close these issues.

1 participant