#docker - August 2018

dockerArchived
20 messages

All things docker
Archive: https://archive.sweetops.com/docker/

August 2018
erik
erikover 8 years ago
@Erik Osterman (Cloud Posse) has joined the channel
erik
erikover 8 years ago
set the channel description: All things docker
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 8 years ago
@Andriy Knysh (Cloud Posse) has joined the channel
Maarten van der Hoef
Maarten van der Hoefover 8 years ago
@Maarten van der Hoef has joined the channel
krogebry
krogebryover 8 years ago
@krogebry has joined the channel
Maarten van der Hoef
Maarten van der Hoefover 8 years ago
So for everyone who is dealing with docker signalling issues, I had some pain with it today with sidekiq not stopping gracefully inside docker. Docker stop sends a SIGTERM to docker pid. In most cases, with /bin/sh -c being the entrypoint, the SIGTERM will only reach the pid of /bin/sh and not the child processes of it. Inside my bash script I was already using exec, but I had to use exec in the CMD line of the Dockerfile to make it to work.

Note the exec.
CMD exec /$APP_DIR/bin/dispatch.sh


And note the exec Inside dispatch.sh
SIDEKIQ_COUNT=3 SIDEKIQ_MAXMEM_MB=2000 SIDEKIQ_PRELOAD=sidekiq_swarm exec sidekiqswarm -t 25 -C config/sidekiq.yml


https://hochzehn.com/insights/docker-stopping-containers-softly.html
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 8 years ago
Aha... so basically, it's running /bin/sh -c 'exec /$APP_DIR/bin/dispatch.sh', which then replaces PID1 with dispatch.sh
I've also run into problems with signal handling and shell scripts with docker.
tamsky
tamskyover 8 years ago
@tamsky has joined the channel
tamsky
tamskyover 8 years ago(edited)
it feels like the format of shell commands can convey a lot of meaning:

SIDEKIQ_COUNT=3 SIDEKIQ_MAXMEM_MB=2000 SIDEKIQ_PRELOAD=sidekiq_swarm && 
    exec sidekiqswarm \
        -t 25 \
        -C config/sidekiq.yml
tamsky
tamskyover 8 years ago

it's running /bin/sh ...


does CMD (and hence RUN) always pick /bin/sh, or does it use the named shebang #! shell at the top of:/$APP_DIR/bin/dispatch.sh ?
jylee
jyleeabout 8 years ago
@jylee has joined the channel
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 8 years ago
@Igor Rodionov would this be nice for our local dev harness stuff? https://github.com/bcicen/ctop
Igor Rodionov
Igor Rodionovabout 8 years ago
@Igor Rodionov has joined the channel
M Hunter
M Hunterabout 8 years ago
@M Hunter has joined the channel
Ruan Arcega
Ruan Arcegaabout 8 years ago
@Ruan Arcega has joined the channel
Alexander Tolstikov
Alexander Tolstikovabout 8 years ago
@Alexander Tolstikov has joined the channel
loweryr
loweryrabout 8 years ago
@loweryr has joined the channel
Justin King
Justin Kingabout 8 years ago
@Justin King has joined the channel
Arkadiy
Arkadiyabout 8 years ago
@Arkadiy has joined the channel
Raghu
Raghuabout 8 years ago
@Raghu has joined the channel
No earlier messagesBrowse by dateSeptember 2018