chore: tier 1 freshness: content/config/containers/multi-service_container.md

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-10-26 22:13:27 +02:00
parent 3f1a01cb71
commit 173c7c4596
2 changed files with 14 additions and 15 deletions

View File

@ -1,12 +1,12 @@
--- ---
description: How to run more than one process in a container description: Learn how to run more than one process in a single container
keywords: docker, supervisor, process management keywords: docker, supervisor, process management
title: Run multiple services in a container title: Run multiple processes in a container
aliases: aliases:
- /articles/using_supervisord/ - /articles/using_supervisord/
- /engine/admin/multi-service_container/ - /engine/admin/multi-service_container/
- /engine/admin/using_supervisord/ - /engine/admin/using_supervisord/
- /engine/articles/using_supervisord/ - /engine/articles/using_supervisord/
--- ---
A container's main running process is the `ENTRYPOINT` and/or `CMD` at the A container's main running process is the `ENTRYPOINT` and/or `CMD` at the
@ -34,7 +34,7 @@ this in a few different ways.
## Use a wrapper script ## Use a wrapper script
Put all of your commands in a wrapper script, complete with testing and Put all of your commands in a wrapper script, complete with testing and
debugging information. Run the wrapper script as your `CMD`. This is a very debugging information. Run the wrapper script as your `CMD`. The following is a
naive example. First, the wrapper script: naive example. First, the wrapper script:
```bash ```bash
@ -66,10 +66,9 @@ CMD ./my_wrapper_script.sh
## Use Bash job controls ## Use Bash job controls
If you have one main process that needs to start first and stay running but If you have one main process that needs to start first and stay running but you
you temporarily need to run some other processes (perhaps to interact with temporarily need to run some other processes (perhaps to interact with the main
the main process) then you can use bash's job control to facilitate that. process) then you can use bash's job control. First, the wrapper script:
First, the wrapper script:
```bash ```bash
#!/bin/bash #!/bin/bash
@ -103,8 +102,8 @@ CMD ./my_wrapper_script.sh
## Use a process manager ## Use a process manager
Use a process manager like `supervisord`. This is a moderately heavy-weight Use a process manager like `supervisord`. This is more involved than the other
approach that requires you to package `supervisord` and its configuration in options, as it requires you to bundle `supervisord` and its configuration into
your image (or base your image on one that includes `supervisord`), along with your image (or base your image on one that includes `supervisord`), along with
the different applications it manages. Then you start `supervisord`, which the different applications it manages. Then you start `supervisord`, which
manages your processes for you. manages your processes for you.

View File

@ -1652,7 +1652,7 @@ Manuals:
- path: /config/containers/runmetrics/ - path: /config/containers/runmetrics/
title: Collect runtime metrics title: Collect runtime metrics
- path: /config/containers/multi-service_container/ - path: /config/containers/multi-service_container/
title: Run multiple services in a container title: Run multiple processes in a container
- path: /config/daemon/prometheus/ - path: /config/daemon/prometheus/
title: Collect metrics with Prometheus title: Collect metrics with Prometheus
- sectiontitle: Daemon configuration - sectiontitle: Daemon configuration