No tienes acceso a esta clase

¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera

Curso de Docker

Curso de Docker

Guido Vilariño

Guido Vilariño

Primeros pasos: hola mundo

7/32
Recursos

Aportes 41

Preguntas 8

Ordenar por:

Los aportes, preguntas y respuestas son vitales para aprender en comunidad. Regístrate o inicia sesión para participar.

Gente les comparto este pequeño cheat sheet con comandos y ejemplos útiles de Docker:
Cheat Sheet

Espero les sirva 😉

Después de la instalación, configuramos nuestro usuario para que pueda utilizar docker sin permisos de root.

  1. Creamos un grupo
sudo groupadd docker
  1. Añadimos nuestro usuario al grupo
sudo usermod -aG docker name_user
  1. Cerramos la terminal y la volvemos abrir
  2. Activar los comandos del grupos
newgrp docker
  1. Verificamos si todo funciona
docker run hello-world

Para los que usamos Windows con WSL2 aqui dejo esta guia para poder usar docker
https://www.youtube.com/watch?v=5RQbdMn04Oc

No les paso que ya se estaban emocionando por ver docker correr? jaja Y luego dijo eso lo veremos en otra clase. .🙄🙄

si estas en linux y debes colocar siempre al inicio sudo coloca estos comandos para no volver a colocar sudo siempre al principio [Donde dice username tienes que colocar tu nombre de usuario]

sudo usermod -aG docker username
su - username
docker run hello-world

donde
docker run comadno para levantar un contenedor
hello-world nombre del contenedor
Nota En caso de que el contenedor no exista en el docker local, lo buscará en el repositorio de docker, lo descargará y ejecutará

Para los que se perdieron al igual que yo y no supieron como llegó hasta aquí el instructor les dejo este video para usar docker con windows https://www.youtube.com/watch?v=_et7H0EQ8fY&ab_channel=TheCoderCaveesp

Otra opción donde pueden encontrar cheatsheet de docker es en:
https://devhints.io/
Aquí también puedes encontrar cheatsheet para otros sistemas, y dentro de docker para el docker-compose.

$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
    (amd64)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

tremendo, mi primer contenedor Hello-world

con la terminal

con git

God bless you my brothers

Creo que falto algo muy importante para los usuarios windows. Hay que seguir unos pasos posterior a la instalación y reinicio del sistema.

https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

Recomendación: Usen Linux o Mac si es que no quieren tener exeso de problemas.

Empieza lo chido

jajaja el primer hello world

– Para correr el contenedor, si no encuentra la imagen hello-world en el local busca en el docker hub y lo descarga.

docker run hello-world

– puedes correr el contenedor de esta manera igualmente

docker container run hello-world

Yo estoy usando Play with Docker. Da 4 hs .

Ejecuté mi primer contenedor 😃

docker run hello-world

Es como cuando creas tu primer hello world jajajajaja

para los que usan linux les dejo el comando que use y la docuumentacion de docker
link
https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user

comandos

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world

Para los mortales, que urtilizamos windows, usen el siguiente comando

docker login -u username -p password

Un “Hola mundo 🐳” que emociona mucho a este frontend, solo que antes de hacer docker run tuve que correr docker pull al contenedor hellow-world

![]()

Correr un contenedor:

´´´
docker run hello-world
´´´
Si no se tiene el repositorio, se descarga de docker hub.

jejeje como en toda herramienta de desarrollo se inicia con un hello-world

  • Si no pueden crear un image en docker corriendo el siguiente comando:
docker run imagen 
  • Primero vayan a Docker Hub creense una cuenta y luego escriban:
docker login
  • Les va a pedir su usr y pwd de Docker Hub, ponganlo y ya pueden correr perfectamente
docker run image

Me costo trabajo pero logre correr docker en WSL con ubuntu.

listo Hello word!

otro curso mas que empieza por el final

Excelente, a seguir aprendiendo escupir bit

sudo docker run hello-world

Cool…

Hola! por si llegan a tener algun error al correr el ejemplo,
en mi caso tuve que hacer:

docker-machine restart default

y luego ya pude seguir con el ejemplo!

espero les sirva!

c

[email protected]-15-db0xxx:~/Escritorio/docker$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Docker run …

  • Si no lo encuentra, lo busca de los repositorios publicos de Docker

sudo docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
    (amd64)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

$ docker run hello-world

aquí les dejo la imagen de hello-world
https://hub.docker.com/_/hello-world

Unos buenos videos para complementar lo aprendido:

Los videos de la serie “Computer Stuff They Didn’t Teach You” son bastante entretenidos.

El famoso Hola Mundo, en docker también es sencillo su ejecución.

me costo llegar hasta acá, pero lo logre, siempre con windows es mas largo, pero con los dos últimos dos cursos he aprendido varias cositas.