Task Description(A)- Configure httpd in docker container
The requirement for this task is to have docker installed in the system.
- Pull the image of the os that we need for the container. command — docker pull <image_name>:version #I will use centos:latest
and check whether the image is there or not by command — docker images
2. launch a docker container with the downloaded image and the command is — docker run -it — name <container_name> <image_name>:<version> …#I will use command docker run -it — name myos_httpd centos:latest
3. Yum is already configured and we can use yum command to install httpd tool so that the container can be used as webserver. command — yum install httpd
4. create an image from the container using commit command.
command — docker commit <container_name> <new_image_name>:<version> # I used docker commit myos_httpd mdk/httpd-image:v1
to check, we can use command docker images
Task Description(B)- Setting up Python Interpreter and running Python Code on Docker Container
- The first thing to do is to pull the docker image that we need for the container. command — docker pull <image_name>:<version> #I will use the previously pulled image (centos:latest).
2. creating container by the image pulled earlier. command — docker run -it — name <container_name> <image_name>:<version> #the command I use is — docker run -it — name myos_python centos:latest
3. Installing python interpreter using yum command. command — yum install python3
check whether the environment is right or not —
4. creating the image from the configured container. command — docker commit <container_name> <new_image_name>:<version>
docker commit myos_python mdk/python:v1
check created image by command docker images.