1
0
Fork 0
mirror of https://github.com/YunoHost/doc.git synced 2024-09-03 20:06:26 +02:00

Merge pull request from romainhk/master

Updates on docker
This commit is contained in:
M5oul 2015-02-03 01:49:02 +01:00
commit 4e7248a204
2 changed files with 14 additions and 9 deletions

View file

@ -54,8 +54,8 @@ You will then be able to [postinstall](/postinstall) all this by entering the co
**Notice:** You may want to forward some of your container's ports, find more information or these pages: **Notice:** You may want to forward some of your container's ports, find more information or these pages:
* http://docs.docker.io/reference/commandline/cli/#run * http://docs.docker.com/reference/commandline/cli/#run
* http://docs.docker.io/use/port_redirection/#port-redirection * http://docs.docker.com/userguide/dockerlinks/
--- ---
@ -85,12 +85,15 @@ iptables -t nat -A POSTROUTING -s '<container.IP>/32' -o eth0 -j SNAT --to-sourc
```bash ```bash
# You will need: # You will need:
# * your container's ID # * your container's ID
docker ps -notrunc | grep yunohost docker ps --no-trunc | grep yunohost
# * your container's PID # * your container's PID
cat /var/lib/docker/execdriver/native/<container_ID>/pid docker ps -q | xargs docker inspect --format '{{.State.Pid}}'
# * `util-linux` package # * `util-linux` package
apt-get install util-linux || pacman -S util-linux apt-get install util-linux || pacman -S util-linux
# Run the nsenter command with the right parameters # Run the nsenter command with the right parameters
nsenter --target <PID> --mount --uts --ipc --net --pid /bin/bash nsenter --target <PID> --mount --uts --ipc --net --pid /bin/bash
# Otherwise, with docker
docker run -t -i yunohost:init /bin/bash
``` ```

View file

@ -53,8 +53,8 @@ Cette commande lancera un conteneur sur la base de l'image `yunohost`, tag `init
**Remarque :** vous pourrez avoir besoin de forwarder certains ports de votre conteneur docker, pour cela consultez les pages de documentation suivantes : **Remarque :** vous pourrez avoir besoin de forwarder certains ports de votre conteneur docker, pour cela consultez les pages de documentation suivantes :
* http://docs.docker.io/reference/commandline/cli/#run * http://docs.docker.com/reference/commandline/cli/#run
* http://docs.docker.io/use/port_redirection/#port-redirection * http://docs.docker.com/userguide/dockerlinks/
--- ---
@ -84,12 +84,14 @@ iptables -t nat -A POSTROUTING -s '<IP conteneur docker>/32' -o eth0 -j SNAT --t
```bash ```bash
# Vous avez besoin : # Vous avez besoin :
# * de votre ID de conteneur # * de votre ID de conteneur
docker ps -notrunc | grep yunohost docker ps --no-trunc | grep yunohost
# * du PID de votre conteneur # * du PID de votre conteneur
cat /var/lib/docker/execdriver/native/<ID_de_mon_conteneur>/pid docker ps -q | xargs docker inspect --format '{{.State.Pid}}'
# du paquet `util-linux` # du paquet `util-linux`
apt-get install util-linux || pacman -S util-linux apt-get install util-linux || pacman -S util-linux
# Lancez la commande nsenter avec les paramètre kivonbien© # Lancez la commande nsenter avec les paramètre kivonbien©
nsenter --target <PID> --mount --uts --ipc --net --pid /bin/bash nsenter --target <PID> --mount --uts --ipc --net --pid /bin/bash
# Sinon, avec docker
docker run -t -i yunohost:init /bin/bash
``` ```