#docker (2018-08)

docker

All things docker

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

2018-08-02

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
09:37:46 PM

@Erik Osterman (Cloud Posse) has joined the channel

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
09:37:46 PM

set the channel description: All things docker

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
09:37:59 PM

@Andriy Knysh (Cloud Posse) has joined the channel

maarten avatar
maarten
09:38:06 PM

@maarten has joined the channel

krogebry avatar
krogebry
09:47:47 PM

@krogebry has joined the channel

maarten avatar
maarten

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) avatar
Erik Osterman (Cloud Posse)

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 avatar
tamsky
02:55:12 AM

@tamsky has joined the channel

tamsky avatar

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 avatar


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 ?

2018-08-05

jylee avatar
jylee
04:29:35 PM

@jylee has joined the channel

2018-08-17

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Igor Rodionov would this be nice for our local dev harness stuff? https://github.com/bcicen/ctop

bcicen/ctop

ctop - Top-like interface for container metrics

Igor Rodionov avatar
Igor Rodionov
02:50:42 AM

@Igor Rodionov has joined the channel

2018-08-22

melynda.hunter avatar
melynda.hunter
04:17:15 AM

@melynda.hunter has joined the channel

2018-08-24

ruan.arcega avatar
ruan.arcega
11:24:54 AM

@ruan.arcega has joined the channel

2018-08-27

tolstikov avatar
tolstikov
11:14:36 AM

@tolstikov has joined the channel

loweryr avatar
loweryr
03:11:39 PM

@loweryr has joined the channel

2018-08-28

justin.dynamicd avatar
justin.dynamicd
05:17:10 PM

@justin.dynamicd has joined the channel

Arkadiy avatar
Arkadiy
06:30:25 PM

@Arkadiy has joined the channel

2018-08-29

Raghu avatar
Raghu
03:04:39 PM

@Raghu has joined the channel

    keyboard_arrow_up