Workshop 3: Docker Imaging
Workshop 3: Docker Image Creation Creating an image from a Dockerfile Create a static website (e.g., search for an HTML5 template) or simply create an index.html file. Create a Dockerfile to build an image with a web server serving the page. You can use a Debian or Ubuntu base image, or an image that already includes a web service, as 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 to create the new image. The image should be named mi_servidor_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