Aquesta és una revisió antiga del document
Dockerfile
fichero de scripting para generar un contenedor
FROM debian:latest RUN apt-get update && apt-get install -y wget
docker build -t <nombre> .
: genera una nueva imagen con repositorio <tag>
vagrant rsync
: sincroniza el directorio «compartido» entre el host y la imagen vagrantinstrucciones
- FROM : imagen-plantilla
- ENV : variables de entorno (modificar PATH)
- ARG : variables de Dockerfile (no en el contenedor)
- COPY : copiar ficheros en la imagen
- ADD
- RUN : ejecutar comandos
- VOLUMEN
- EXPOSE
- ENTRYPOINT
- CMD
- USER
- WORKDIR = cd
FROM
imagen de referencia
''FROM <image>'' ''FROM <image:tag>'' ''FROM <@id_imagen>''
RUN
ejecuta comandos en el contenedor (linux)
CMD
comando por defecto
'' CMD ["echo","hello world"]''