Herramientas de usuario

Herramientas del sitio


wiki2:docker

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
wiki2:docker [2018/11/19 14:37]
alfred [Using Docker as not root user]
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 381: 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 603: 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>​  +
-$ groupadd docker +
-$ gpasswd -a alfred docker +
-</​code>​ +
-O lo que es lo mismo:+
 <​code>​ <​code>​
 $ sudo groupadd docker $ sudo groupadd docker
 $ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
 +</​code>​
 +
 +If it did not work:
 +<​code>​
 +sudo groupadd docker
 +sudo usermod -aG docker $USER
 +newgrp docker
 +docker run hello-world
 </​code>​ </​code>​
 ==== The Docker service configuration ==== ==== The Docker service configuration ====
wiki2/docker.1542638226.txt.gz · Última modificación: 2020/05/09 09:24 (editor externo)