Skip to content

🐳 Docker is a complete container management platform. Throughout this course you will learn what Docker is, why to use it and you will be introduced to the management of these containers with practical examples that guide you through the world of managing applications with containers.

Notifications You must be signed in to change notification settings

brian-emarquez/Docker-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn Docker | Containers using Interactive Browser Based Scenarios

Stars Forks

Install

📦 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

Correcion del Error - Instalaccion

System has not been booted with systemd as init system (PID 1). Can't operate - Systemctl

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

DockerHub

  • Tutorial Docker

Tutorial Docker - Cómo instalar y usar Docker en Ubuntu 20.04

Images Docker

DockerFiles

  • Creador de imagenes

Descargar una imagen de postgre 9.6

docker run postgres:9.6

Comandos Comunes

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

Comandos en casos de proyectos

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"]

Docker Hub

Ejemplo

docker pull node
docker pull alpine

Construccion del Contenedor

docker build -t getting-started

Ejecutar

docker run -dp 3000:3000 getting-started

Guardar un contenedor

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

Reconstruir Imagen Docker

sudo docker run -d -v /home/brian/Documents/Docker/etc/etc:/etc/todos -p 3000:3000 getting-started

Spotify

🎵 Music List on Spotify 🎤

Paypal Donation

🩸 Hacer una donación PAYPAL 🍵


A B
C E
F G

About

🐳 Docker is a complete container management platform. Throughout this course you will learn what Docker is, why to use it and you will be introduced to the management of these containers with practical examples that guide you through the world of managing applications with containers.

Topics

Resources

Stars

Watchers

Forks