Diferencia entre revisiones de «Creando mi propia imagen»
De Wiki de EGC
Línea 9: | Línea 9: | ||
<syntaxhighlight lang="sh"> | <syntaxhighlight lang="sh"> | ||
− | # apt-get update | + | root@d66f7a3268e6:/# apt-get update |
− | # apt-get install apache2 | + | root@d66f7a3268e6:/# apt-get install apache2 |
apt-get install apache2 | apt-get install apache2 | ||
Reading package lists... Done | Reading package lists... Done | ||
Línea 16: | Línea 16: | ||
Reading state information... Done | Reading state information... Done | ||
The following additional packages will be installed: | The following additional packages will be installed: | ||
− | apache2-bin apache2-data apache2-utils | + | apache2-bin apache2-data apache2-utils ... |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
The following NEW packages will be installed: | The following NEW packages will be installed: | ||
− | apache2 apache2-bin apache2-data apache2-utils | + | apache2 apache2-bin apache2-data apache2-utils ... |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
0 upgraded, 57 newly installed, 0 to remove and 4 not upgraded. | 0 upgraded, 57 newly installed, 0 to remove and 4 not upgraded. | ||
Need to get 22.6 MB/22.6 MB of archives. | Need to get 22.6 MB/22.6 MB of archives. | ||
After this operation, 102 MB of additional disk space will be used. | After this operation, 102 MB of additional disk space will be used. | ||
Do you want to continue? [Y/n] | Do you want to continue? [Y/n] | ||
+ | ... | ||
+ | root@d66f7a3268e6:/# | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Línea 48: | Línea 30: | ||
<syntaxhighlight lang="sh"> | <syntaxhighlight lang="sh"> | ||
− | # exit | + | root@d66f7a3268e6:/# exit |
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="sh"> | <syntaxhighlight lang="sh"> | ||
− | # docker commit -m "Imagen de ubuntu con apache2" -a "profe" | + | # docker commit -m "Imagen de ubuntu con apache2" -a "profe" d66f7a3268e6 ubuntu/apache2 |
</syntaxhighlight> | </syntaxhighlight> |
Revisión del 15:40 26 oct 2017
Podemos modificar una imagen existente y guardarla con un nombre diferente:
# docker run -it ubuntu bash
root@d66f7a3268e6:/#
Fijaros en que el prompt del interprete de ordenes ha cambiado e indica el numero que identifica de manera unica al contenedor que hemos lanzado. Este numero cambia para cada nueva instancia que lanzamos.
root@d66f7a3268e6:/# apt-get update
root@d66f7a3268e6:/# apt-get install apache2
apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils ...
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils ...
0 upgraded, 57 newly installed, 0 to remove and 4 not upgraded.
Need to get 22.6 MB/22.6 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Do you want to continue? [Y/n]
...
root@d66f7a3268e6:/#
Escribo 'Y' y pulso enter para comenzar la instalacion del servidor web apache2.
root@d66f7a3268e6:/# exit
# docker commit -m "Imagen de ubuntu con apache2" -a "profe" d66f7a3268e6 ubuntu/apache2