Académique Documents
Professionnel Documents
Culture Documents
Title Docker
Duration 60 minutes
4) Log out and login back as the same user to enable this change. Check that docker is running using
the command and to view system-wide information about Docker
5) Check access to Docker Hub (a docker image registry) by running a simple command
6) Search for Ubuntu image in Docker hub and pull it. View the list of images in our machine using
docker images command
7) Run the downloaded ubuntu image with interactive shell access by passing options i and t
8) Exit the container. Now lets create our own web server image from the ubuntu image. Next clone a
sample php app from git and view the Dockerfile in it by the following commands.
9) Dockerfile contains information about the base image to be used and the operations such as install
packages, configuring the code that are need to be done before creating a new docker image.
10) Now build a docker image with following command. I create my image with name myapache.
-t stands for automatic tagging of our image.
docker ps -a
13) Now we want to modify this image. We can login into the container using the following command
14) Change the web page content by running the following command and exit
15) Now Create a new image from this container using the following command where mymodified is
the name for my new image. Use docker images to check the new image.
16) To stop and delete the old container, type the following
17) Now start our new image with the same port and check it in the browser
18) Additionally, you can push your images to your docker hub account. For that, login using the
following command. You can sign up at https://hub.docker.com
19) Tag image and push it to the docker hub using the following commands.
20) After this, you can pull the image from anywhere using this command