Dockerization
Note: Install docker through the link:
[Link]
1. Make a directory for docker
mkdir DockerFiles
2. Navigate to this directory
cd Documents/DockerFiles
3. Make a Dockerfile
touch Dockerfile
4. Write Dockerfile
vim Dockerfile (open the Dockerfile in vim editor and mention the
flags like Base Image, Maintainer, RUN, CMD etc... and save the file)
5. Build the docker image
docker build -t <imagename> .
Or
docker build .
6. check the image by listing all the images
docker images
7. Run the docker container
docker run - -name <container name> <image name or imageid>
8. check the container by listing all the containers
docker ps -a
9. Always remember to delete your container after it is executed
docker rm <container name or container id>
10. To delete docker image:
docker rmi <image name or image id>
Dockerization of a Flask App
1. Make a directory for Flask app
mkdir FlaskApp
2. Navigate to this directory
cd Documents/FlaskApp
3. Create files
● [Link]
● Dockerfile
● [Link]
touch Dockerfile [Link] [Link]
4. Write the instructions in the above files through vim editor
vim Dockerfile
vim [Link]
vim [Link]
5. Build the docker image
docker build -t <imagename> .
Or
docker build .
6. check the image by listing all the images
docker images
7. Run the docker container
docker run - -name <container name> --p x:y <image name or
imageid>
8. check the container by listing all the containers
docker ps -a
9. Always remember to delete your container after it is executed
docker rm <container name or container id>
10. To delete docker image:
docker rmi <image name or image id>
To do Tasks:
1. Make your account on docker hub.
2. Push the images built by you on your docker hub account.