Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:docker [2018/04/14 09:06] alfred [Fast use] |
wiki2:docker [2020/11/07 13:33] (actual) |
||
|---|---|---|---|
| Línea 6: | Línea 6: | ||
| <code> | <code> | ||
| - | docker run -v /home/alfred/tmp/data:/data/db -p 27017:27017 mongo | + | docker run --rm -d -v /home/alfred/tmp/data:/data/db -v /tmp:/tmp -p 27017:27017 --name mongo mongo |
| </code> | </code> | ||
| Línea 57: | Línea 57: | ||
| + | Para instalarlo en un server virtual, este ha de ser KVM. | ||
| ===== How to use it ===== | ===== How to use it ===== | ||
| Línea 380: | Línea 381: | ||
| Whe we run ''docker compose down'' we are shutting down the containers. | Whe we run ''docker compose down'' we are shutting down the containers. | ||
| + | ==== Volumes ==== | ||
| + | <code> | ||
| + | docker volume ls | ||
| + | docker volume prune | ||
| + | </code> | ||
| ==== With networks ==== | ==== With networks ==== | ||
| <code> | <code> | ||
| Línea 602: | Línea 608: | ||
| > The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The docker daemon always runs as the root user. If you don’t want to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group. | > The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The docker daemon always runs as the root user. If you don’t want to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group. | ||
| - | Still I did not achieve to run it as my own user, the steps would be: | + | The steps would be: |
| - | <code> | + | <code> |
| - | $ groupadd docker | + | $ sudo groupadd docker |
| - | $ gpasswd -a alfred docker | + | $ sudo usermod -aG docker $USER |
| </code> | </code> | ||
| + | If it did not work: | ||
| + | <code> | ||
| + | sudo groupadd docker | ||
| + | sudo usermod -aG docker $USER | ||
| + | newgrp docker | ||
| + | docker run hello-world | ||
| + | </code> | ||
| ==== The Docker service configuration ==== | ==== The Docker service configuration ==== | ||
| You can control the docker service with: ''service docker start|stop|restart|status''. | You can control the docker service with: ''service docker start|stop|restart|status''. | ||