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

Daemon docker run fails to exit correctly #78

Open
bartjkdp opened this issue Nov 27, 2019 · 3 comments
Open

Daemon docker run fails to exit correctly #78

bartjkdp opened this issue Nov 27, 2019 · 3 comments

Comments

@bartjkdp
Copy link

bartjkdp commented Nov 27, 2019

I use the following configuration to spin up a Docker container as daemon, but modd fails to kill the container when modd is exited.

modd.conf

{
    daemon +sigterm: docker run \
        --rm \
        -p 5556:5556 \
        -v $(PWD)/dex.yaml:/config.yaml \
        quay.io/dexidp/dex:v2.20.0 \
        serve /config.yaml
}

When I run the process manually it responds to SIGTERM and kills it:

$ docker run \
        --rm \
        -p 5556:5556 \
        -v $(PWD)/dex.yaml:/config.yaml \
        quay.io/dexidp/dex:v2.20.0 \
        serve /config.yaml &
[1] 8414

$ kill 8414
[1]  + 8414 exit 2     docker run --rm -p 5556:5556 -v $(PWD)/dex.yaml:/config.yaml  serve 

I am using:

  • modd 0.8
  • OSX 10.15.1

Do you have any suggestions how I can further debug this issue?

@bartjkdp bartjkdp changed the title Daemon docker run is not exited correctly Daemon docker run fails to exit correctly Nov 27, 2019
@wader
Copy link

wader commented Mar 22, 2020

Maybe could try exec docker run .... if the shell is not forwarding the signal to docker. Also could try set @shell = bash and use exec

@bartjkdp
Copy link
Author

bartjkdp commented Mar 22, 2020

Thanks a lot @wader. Just tried this, but unfortunately it does not work:

@shell = bash

{
    daemon +sigterm: exec docker run \
        --rm \
        -p 5556:5556 \
        -v $(PWD)/dex.yaml:/config.yaml \
        quay.io/dexidp/dex:v2.20.0 \
        serve /config.yaml
}

Pull request #79 fixes the problem, but I am not sure this is the right way to go for modd. I think Docker does not respond correctly to the kill signal.

@wader
Copy link

wader commented Mar 22, 2020

Aha sorry not sure how i missed this was during exit, assumed it was about restarting on change. Yeah somethinh like your PR would make sense i guess, send signal wait for exit or timeout and kill

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 a pull request may close this issue.

2 participants