Open
Conversation
runnabro
commented
Oct 13, 2016
|
|
||
| ### Phusion base image | ||
|
|
||
| The simplest way to get started is to use [phusion-baseimage](https://github.com/phusion/baseimage-docker "https://github.com/phusion/baseimage-docker") |
runnabro
commented
Oct 13, 2016
| #### app1.sh | ||
| This is the runit script for our first app. We send the output to STDOUT so that the Docker logs can handle it. Without <a href="https://en.wikipedia.org/wiki/Shebang_(Unix)">shebang</a> (`#!/bin/sh`), the following error will occur: `runsv app1: fatal: unable to start ./run: exec format error` | ||
|
|
||
| Again, we send the output to STDOUT so that the Docker logs can handle it. |
runnabro
commented
Oct 13, 2016
| ``` | ||
|
|
||
| #### app2.sh | ||
| App2 runit script |
runnabro
commented
Oct 13, 2016
| exec python /app2.py >> /dev/stdout 2>&1 | ||
| ``` | ||
|
|
||
| #### Note for windows users: |
runnabro
commented
Oct 13, 2016
| tags: | ||
| - docker | ||
| - python | ||
| excerpt: Although Docker best practices recommend running one application per container, you may need to run a multiprocess app or create a standalone multi-app Docker image. |
runnabro
commented
Oct 13, 2016
|
|
||
| ### 2. Signal handling | ||
|
|
||
| By default, PID1 ignores the interrupt `SIGINT` and the termination signal `SIGTERM`. In response to the `docker stop` command (which sends `SIGTERM` to your container's PID1), you must relay `SIGTERM` to all your running processes to terminate them cleanly. |
Member
Author
There was a problem hiding this comment.
Editor Comment:
The second sentence is unclear. Please review my changes to make sure the meaning has been preserved. In particular:
"...PID1 must relay this signal..."
Which signal?
runnabro
commented
Oct 13, 2016
|
|
||
| If you do not need process supervision, you can use [tini](https://github.com/krallin/tini "https://github.com/krallin/tini") as a lightweight init process. Tini also handles signals. | ||
|
|
||
| [S6](http://skarnet.org/software/s6/ "http://skarnet.org/software/s6/") is a complete solution: a minimal process supervisor that also acts as an init process. |
Member
Author
There was a problem hiding this comment.
Editor Comment:
"...a minimal process supervisor..."
What does "minimal" mean in this context?
runnabro
commented
Oct 13, 2016
| #### app1.sh | ||
| This is the runit script for our first app. We send the output to STDOUT so that the Docker logs can handle it. Without <a href="https://en.wikipedia.org/wiki/Shebang_(Unix)">shebang</a> (`#!/bin/sh`), the following error will occur: `runsv app1: fatal: unable to start ./run: exec format error` | ||
|
|
||
| Again, we send the output to STDOUT so that the Docker logs can handle it. |
Member
Author
There was a problem hiding this comment.
Editor Comment:
"We send the output to STDOUT so that the Docker logs can handle it."
What is "it"?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Editor Comment: