Docker Basic Flashcards

1
Q

Comando para listar las imagenes registradas?

A

$docker image list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Comando para ver los contenedores corriendo o que correieron?

A

$docker ps -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Comando para correr una imagen sin, deatacharla a la termina, y sin parámetros de arranque?

A

$docker run [image_name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Comando para descargar una imagen de Docker Hub?

A

$docker pull [url image]:[tag]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Como se puede interpretar un tag en una imagen en Docker Hub?

A

De varias maneras, pero la más común y más recomndable es la versión.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Como inicar iniciar una imagen y deatacharla de la terminar de comandos?

A

$docker run [imange_name] -d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Como obtener los logs de un contenedor en ejecución?

A

$docker logs [image_name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Como detener un contenerdor en ejecución?

A

$docker stop [image_name ó Image_id]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Como eliminar un contenedor?

A

$docker rm [image-name ó Image_id]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

como eliminar una imagen?

A

$docker image rm [image-name ó Image_id]

(*) No debe haber un contenedro de esta imagen corriendo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

En el comando:

$docker run -p 3356:8823 –name my-container [url-docker-hub]:[tag]

Qué cual es el porto del host y cual es el puerto del contendor, al cual esta mapeado en el host?

A

-p [HostPort:ContPort]
+ 3356 Puerto del Host
+ 8823 es el Container Port

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

En el comando:

$docker run -p 3356:8823 –name my-container [url-docker-hub]:[tag]

Cual es la función de [url-docker-hub]:[tag]?

A

Indicar la imagen, con su TAG/Version, que se ejecutará

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

En el comando:

$docker run -p 3356:8823 –name my-container [url-docker-hub]:[tag]

Cual es la función de –name my-container?

A

Asigna un nombre al contenedor, con el que se indentificará más facil al momento e verificar cuales son los contenedores en ejecución.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Cuantas veces se puede usar el parámetro -p sobre el comando run?

A

Muchas veces.

Se utiliza para mapear los puertos del Contenedor contra los puertos del Host:

$docker run -p 3356:8823 -p 9090:8080 [url-docker-hub]:[tag]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

En en comando docker run cual es la diferencia de usar -p contra -P

A

+ -p publica los puertos especificados, permite el mapeo.
+ -P Publica de manera aleatoria, hacia el host, los puertos del Contenerdor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Como correr una imagen y eliminar el container al momento de terminarse la ejecución?

A

docker run --rm --name <name_cont> <iamge_name>

docker run –help

17
Q

How to delete all virtual networks previously created?

A

docker network prune

18
Q

How to list all virtual networks?

A

docker network ls

19
Q

Which command can be used to stop all running containers?

A

docker stop $(docker ps -a -q)

-q display only de Containers ID of all containers.

20
Q

What is the git command to compare an specific path over the HEADER?

A

using git diff as:
$git diff HEAD {path}
or you can omit HEAD
$git diff {path}

https://www.atlassian.com/git/tutorials/saving-changes/git-diff

21
Q

How can git show all the change since the last commit?

A

$git diff

https://www.atlassian.com/git/tutorials/saving-changes/git-diff

22
Q

How can campare the change between two commits?

A

$git diff {commit_a} {commit_b}

https://www.atlassian.com/git/tutorials/saving-changes/git-diff

23
Q

How can git compare the same file from two branches?

A

$git diff {branch_a} {branch_b} {file_path}

https://www.atlassian.com/git/tutorials/saving-changes/git-diff

24
Q

Which is the meaning of this output?
```cmd
diff –git a/diff_test.txt b/diff_test.txt
index 6b0c6cf..b37e70a 100644
— a/diff_test.txt
+++ b/diff_test.txt
@@ -1 +1 @@
-Line 1
+line 1.mod
~~~

A

That the file a/diff_test.txt b/diff_test.txt has changed in:
1. Comparing the tow sourcer ´a/diff_test.txt b/diff_test.txt´.
2. The line Line 1 has been removed in commit b from a.
3. The line Line 1.mod has been added in commit b from a.
4. @@ -1 +1 @@ Shows which lines are changed, removed (-) or added (+).

https://www.atlassian.com/git/tutorials/saving-changes/git-diff