Docker Use Cases

Docker:

  • Configure HTTPD Server on Docker Container
  • Set Up Python Interpreter and running Python Code on Docker Container

Setting Up Docker

  • Set up repo for docker-ce Software.
    “vi /etc/yum.repos.d/<reponame>.repo”
  • Install the docker-ce software.
    “yum install docker-ce — — no-best”
  • Start the service.
    “systemctl start docker”

Launching a Docker Container

  • Pull an Image of which we want to launch the container.
    “docker pull <image name>”
  • Launch the Container.
    “docker run -i -t — — name <container name> <image name>”

Configuring HTTPD Server on Docker Container

  • Install the httpd Software.
    “yum install httpd”
  • Set up web pages.
    “vi /var/www/html/index.html”
  • Start the Service.
    As “systemctl start httpd” do not work, use “/usr/sbin/httpd”

Setting Up Python Interpreter and running Python Code on Docker Container

  • Install python3.
    “yum install python3”
  • Write Python Code.
    “vi <filename>”
  • Run code.
    python3 <filename>”

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store