📦 Install Docker en Ubuntu Develop faster.
Run anywhere.
📦 Install Docker en Windows Accelerate how you build, share and run modern applications.
📦 Install Docker Compose en Ubuntu Accelerate how you build, share and run modern applications.
Inicializar Docker Ubuntu
service docker start
service docker status
service docker stop
System has not been booted with systemd as init system (PID 1). Can't operate - Systemctl
- Download the latest package: https://docs.microsoft.com/en-us/windows/wsl/install-manual
If you're using an ARM64 machine, please download the ARM64 package instead. If you're not sure what kind of machine you have, open Command Prompt or PowerShell and enter: systeminfo | find "System Type". Caveat: On non-English Windows versions, you might have to modify the search text, for example, in German it would be systeminfo | find "Systemtyp".
Fix: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Error al inicializar Docker Ubuntu
sudo update-alternatives --config iptables
Then re-start docker service
sudo service docker start
And check docker status again with
sudo service docker status
Documentation Fix: Cannot connect to the Docker daemon
- Tutorial Docker
Tutorial Docker - Cómo instalar y usar Docker en Ubuntu 20.04
DockerFiles
- Creador de imagenes
Descargar una imagen de postgre 9.6
docker run postgres:9.6
Version de Docker
docker --version
Version de Docker compose
docker-compose --version
Permite correr un contenedor
docker run
Permite descargar imagen y no correr
docker pull
Permite ver la imagenes
docker images | head
Suprimir el Sudo del principio
sudo usermod -aG docker ${USER}
su - ${USER}
Permite ver los contenedores corriendo
docker ps
Permite ver los contenedores que corriendo hace un tiempo
docker ps -a
Permite recuperar los datos de un contenedor
docker start ContainerID
Ver los Logs
docker log ContainerID
Eliminar Contenedor
docker rmi Idcontainer
Ejecutar comando en un Docker en funcionamiento
docker exec -it ContainerID sh
- ls
Detener contenedor
docker stop ContainerID
Ejecutar en Backbround
docker run -d nombre
Contruir Imagen
docker build -t devrrior/docker-django .
Correr Imagen
docker run -p 8000:8000 devrrior/docker-djando
Correr sin log
docker run -d -v /home/briandb/docker-django/:/app -p 8000:8000 devrrior/docker-django
[5704613836e41711efa45f5e875257c6bae734e68b18668f022040d3fd8133e7]
Correr con Log
docker logs --follow 5704613836e41711efa45f5e875257c6bae734e68b18668f022040d3fd8133e7
Entrar al contenedor
docker exec -it 5704613836e41711efa45f5e875257c6bae734e68b18668f022040d3fd8133e7 /bin/sh
Volumenes
docker run -v /home/briandb/docker-django/:/app -p 8000:8000 devrrior/docker-django
dentro de la careta donde se tien un proyecto!
vim Dockerfile
Ejemplo
FROM node:12.22.1-alpine3.11
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "/app/src/index.js"]
Ejemplo
docker pull node
docker pull alpine
docker build -t getting-started
docker run -dp 3000:3000 getting-started
sudo docker run -d -v /home/brian/Documents/Docker/etc/etc:/etc/todos -p 3000:3000 getting-started
- Detener y volver a ejecutar, se guardaraon los cambios
- ir a localhost:3000
sudo docker run -d -v /home/brian/Documents/Docker/etc/etc:/etc/todos -p 3000:3000 getting-started
🎵 Music List on Spotify 🎤
🩸 Hacer una donación PAYPAL 🍵
A | B | ||
C | E | ||
F | G |