Centos + apache2 + archivos HTML

Sencillo ejemplo de Dockerfile con Centos, Apache2 y archivos HTML.

FROM centos

LABEL version="1.0.0"
LABEL description="Esto es mi primera web con Docker"
LABEL vendor="yo"

RUN yum install httpd -y

WORKDIR /var/www/html

COPY mi_web .

RUN echo "$(whoami)" > ./user1.html

RUN useradd eduardo

RUN chown eduardo /var/www/html -R

USER eduardo

ENV contenido prueba2

RUN echo "$contenido creado por <b> $(whoami) </b>" > /tmp/prueba.html 


USER root

RUN cp /tmp/prueba.html ./prueba.html

COPY run.sh /run.sh

CMD sh /run.sh

Estructura de directorios.

Dockerfile run.sh mi_web |_____ index.html

run.sh

index.html

Crear Imagen

Montar Contenedor

Last updated

Was this helpful?