You've already forked docker-erlang-example
mirror of
https://github.com/erlang/docker-erlang-example.git
synced 2025-08-01 10:06:50 +03:00
Add init to all docker examples
This commit is contained in:
@ -135,13 +135,14 @@ For some more details of what this command does, see [README-CERTS.md](README-CE
|
|||||||
|
|
||||||
We start the image in a docker container by issuing the following command.
|
We start the image in a docker container by issuing the following command.
|
||||||
|
|
||||||
$ docker run -d -p 8443:8443 --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=syslog erlang-dockerwatch
|
$ docker run -d -p 8443:8443 --init --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=syslog erlang-dockerwatch
|
||||||
870f979c5b4cdb7a1ba930b020043f50fa7457bf787237706fb27eefaf5fe61d
|
870f979c5b4cdb7a1ba930b020043f50fa7457bf787237706fb27eefaf5fe61d
|
||||||
|
|
||||||
Let's parse some of the input.
|
Let's parse some of the input.
|
||||||
|
|
||||||
* `-d`, starts the container in the background and prints the container ID.
|
* `-d`, starts the container in the background and prints the container ID.
|
||||||
* `-p 8443:8443`, exposes port `8443` from the container to our localhost.
|
* `-p 8443:8443`, exposes port `8443` from the container to our localhost.
|
||||||
|
* `--init`, use the tini initialization as PID 1 in order to prevent zombie processes.
|
||||||
* `--volume="$PWD/ssl:/etc/ssl/certs"`, mounts our local directory
|
* `--volume="$PWD/ssl:/etc/ssl/certs"`, mounts our local directory
|
||||||
(`$PWD/ssl`) with certificates to `/etc/ssl/certs` the container.
|
(`$PWD/ssl`) with certificates to `/etc/ssl/certs` the container.
|
||||||
* `--log-driver=syslog`, will log all data from stdout in the container to our local syslog.
|
* `--log-driver=syslog`, will log all data from stdout in the container to our local syslog.
|
||||||
|
@ -84,6 +84,7 @@ services:
|
|||||||
dockerwatch:
|
dockerwatch:
|
||||||
build: .
|
build: .
|
||||||
image: dockerwatch
|
image: dockerwatch
|
||||||
|
init: true
|
||||||
ports:
|
ports:
|
||||||
- "8443:8443"
|
- "8443:8443"
|
||||||
logging:
|
logging:
|
||||||
@ -181,4 +182,4 @@ Start Kibana (configuration found in kibana/config/kibana.yml, $ELASTICSEACH_URL
|
|||||||
|
|
||||||
Start dockerwatch application
|
Start dockerwatch application
|
||||||
|
|
||||||
docker run -p 8443:8443 --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
docker run -p 8443:8443 --init --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
version: "2"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
dockerwatch:
|
dockerwatch:
|
||||||
build: .
|
build: .
|
||||||
image: dockerwatch
|
image: dockerwatch
|
||||||
|
init: true
|
||||||
ports:
|
ports:
|
||||||
- "8443:8443"
|
- "8443:8443"
|
||||||
logging:
|
logging:
|
||||||
|
@ -6,7 +6,7 @@ set -x
|
|||||||
docker build -t logstash logstash/
|
docker build -t logstash logstash/
|
||||||
docker run --name logstash -d -p 9600:9600 -p 44622:44622/udp logstash
|
docker run --name logstash -d -p 9600:9600 -p 44622:44622/udp logstash
|
||||||
docker build -t dockerwatch .
|
docker build -t dockerwatch .
|
||||||
docker run --name dockerwatch -d -p 8443:8443 --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
docker run --name dockerwatch -d -p 8443:8443 --init --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
||||||
IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockerwatch)
|
IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockerwatch)
|
||||||
# Wait for logstash to finis startup
|
# Wait for logstash to finis startup
|
||||||
until curl -s 'localhost:9600/_node'; do sleep 5; echo "waiting for logstash to finish startup"; done
|
until curl -s 'localhost:9600/_node'; do sleep 5; echo "waiting for logstash to finish startup"; done
|
||||||
|
@ -57,7 +57,7 @@ To forward log events (single line printouts to STDOUT) from the
|
|||||||
docker-erlang-example image into the Logstash container, use the
|
docker-erlang-example image into the Logstash container, use the
|
||||||
`gelf` log driver and specify the UDP port number, for example:
|
`gelf` log driver and specify the UDP port number, for example:
|
||||||
|
|
||||||
docker run -p 8443:8443 --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
docker run -p 8443:8443 --init --volume="$PWD/ssl:/etc/ssl/certs" --log-driver=gelf --log-opt gelf-address=udp://0.0.0.0:44622 dockerwatch
|
||||||
|
|
||||||
In general, a single line printout from Erlang's Logger can for
|
In general, a single line printout from Erlang's Logger can for
|
||||||
instance be:
|
instance be:
|
||||||
|
Reference in New Issue
Block a user