Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia |
info:cursos:altran:docker:dockerfile [19/07/2018 02:33] – mate | info:cursos:altran:docker:dockerfile [03/01/2019 02:44] (actual) – [COPY] mate |
---|
''docker build -t <nombre> .'': genera una nueva imagen con repositorio <tag> | ''docker build -t <nombre> .'': genera una nueva imagen con repositorio <tag> |
| |
<callout type="info" icon="true">''vagrant rsync'' : sincroniza el directorio "compartido" entre el host y la imagen vagrant</callout> | <callout type="info" icon="true">''vagrant rsync'' : sincroniza el directorio "compartido" entre el host y la imagen vagrant |
| También se puede lanzar un proceso vagrant rsync-auto que se encarga de ir haciendo este proceso automaticamente</callout> |
| |
== instrucciones | == instrucciones |
=== FROM | === FROM |
imagen de referencia | imagen de referencia |
''FROM <image>'' | * ''FROM <image>'' |
''FROM <image:tag>'' | * ''FROM <image:tag>'' |
''FROM <@id_imagen>'' | * ''FROM <@id_imagen>'' |
| |
=== RUN | === RUN |
| |
=== COPY | === COPY |
* ''COPY file /path/to/file'' | * ''COPY file /path/to/file'' : copia **file** en **/path/to/** con el nombre **file** |
* ''COPY [--chown=<user||uid>:<group||gid>] file /path/to/file'' | * ''COPY [--chown=<user||uid>:<group||gid>] file /path/to/file'' |
* ''COPY file file2 file3 /tmp/'' | * ''COPY file file2 file3 /tmp/'' : copia los **file%%*%%** en el directorio **/tmp/** |
* ''COPY fil* /tmp/'' | * ''COPY fil* /tmp/'' : idem anterior |
* ''COPY . /tmp/'' : no usar * | * ''COPY . /tmp/'' : no usar * si se quieren copiar todos los archivos |
| * ''COPY /path/origen/* /path/destino/'' : copiará todos los archivos contenidos en **/path/origen/** en **/path/destino/** SIN ESTRUCTURA DE DIRECTORIOS |
| * ''COPY /path/origen/ /path/destino/'' : idem anterior, pero conservando los directoriorios |
| |
<callout type="warning" icon="true">UNION FILE SYSTEM - relación con layers | <callout type="warning" icon="true">UNION FILE SYSTEM - relación con layers |
| |
=== arg | === arg |
* ''arg key=value'': variables de uso interno | * ''arg key=value'': variables de uso interno -> buildtime |
| |
| {{ :info:cursos:altran:docker:pasted:20181009-081905.png }} |
| |
=== env | === env |
* ''env key=value'': variables de entorno en el contenedor (para nuestra app) | * ''env key=value'': variables de entorno en el contenedor (para nuestra app) -> runtime |
| |
=== add | === add |