Workshop 3: Docker Imaging
Workshop 3: Docker Image Creation Creating an image from a Dockerfile
1.Create a static website (e.g. search for an HTML5 template). Or just create an index.htm ml.
Create a Dockerfile file to create an image with a web server by serving the page. You can use a debian or ubuntu base image, or an image that already has a web service, as we have seen in Example 1: Image construction with a static page. javiercruces@docker:~/taller3$ cat Dockerfile #syntax=docker/dockerfile:1 FROM httpd:2.4 COPY ./public_html/ /usr/local/apache2/htdocs/ EXPOSE 80 Run the docker command that creates the new image. The image should be called my_server_web:v1. javiercruces@docker:~/taller3$ docker build -t javiersaping/mi_servidor_web:v1 . Sending build context to Docker daemon 3.584kB Step 1/3 : FROM httpd:2.4 ---> 92fa43a2ff60 Step 2/3 : COPY ./public_html/ /usr/local/apache2/htdocs/ ---> b03556dd59b6 Step 3/3 : EXPOSE 80 ---> Running in 1cc04e1deee4 Removing intermediate container 1cc04e1deee4 ---> 3078183767ef Successfully built 3078183767ef Successfully tagged javiersaping/mi_servidor_web:v1 javiercruces@docker:~/taller3$ docker run -d -p 8081:80 javiersaping/mi_servidor_web:v1 2a753adcd098c49b7b215b7c97267a09e09194303bee131150765222a4295dea