#docker (2018-08)
All things docker
Archive: https://archive.sweetops.com/docker/
2018-08-02
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
@Erik Osterman (Cloud Posse) has joined the channel
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
@Andriy Knysh (Cloud Posse) has joined the channel
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
@maarten has joined the channel
![krogebry avatar](https://secure.gravatar.com/avatar/f49ced1d69d92f99bb7acbfb975ed4f1.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0026-72.png)
@krogebry has joined the channel
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
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](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
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](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
@tamsky has joined the channel
![tamsky avatar](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
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](https://avatars.slack-edge.com/2019-10-31/817094217669_6e765cea39b456597957_72.jpg)
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](https://secure.gravatar.com/avatar/bc8ca658e12a38513df5684f7d985502.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
@jylee has joined the channel
2018-08-17
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
@Igor Rodionov would this be nice for our local dev harness stuff? https://github.com/bcicen/ctop
ctop - Top-like interface for container metrics
![Igor Rodionov avatar](https://secure.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Igor Rodionov has joined the channel
2018-08-22
![melynda.hunter avatar](https://secure.gravatar.com/avatar/299f6c0672870ecc576263062302b6a3.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png)
@melynda.hunter has joined the channel
2018-08-24
![ruan.arcega avatar](https://avatars.slack-edge.com/2019-06-28/682016987190_83da81f915037f35f3ec_72.png)
@ruan.arcega has joined the channel
2018-08-27
![tolstikov avatar](https://avatars.slack-edge.com/2018-09-20/439670551077_0515c2a106a4f3ca0ff6_72.jpg)
@tolstikov has joined the channel
![loweryr avatar](https://secure.gravatar.com/avatar/52ad9654e32d11c86446041a9cdb5c79.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
@loweryr has joined the channel
2018-08-28
![justin.dynamicd avatar](https://secure.gravatar.com/avatar/a0c4b7aa02ee2f167ca97da2bcb86c79.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0012-72.png)
@justin.dynamicd has joined the channel
![Arkadiy avatar](https://secure.gravatar.com/avatar/b54c5db9e5993bd001c52403e78ccfe3.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0017-72.png)
@Arkadiy has joined the channel
2018-08-29
![Raghu avatar](https://secure.gravatar.com/avatar/8ade94b696b86d19097bfc4a1529275e.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0009-72.png)
@Raghu has joined the channel