Docker Use Cases

Docker:

Docker is an open platform for developing, shipping, and running applications. Docker enables us to separate our applications from our infrastructure so we can deliver software quickly. With Docker, we can manage our infrastructure in the same way we manage our applications.

By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, we can significantly reduce the delay between writing code and running it in production.

In this article, we will:

  • 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”

We can see docker service is now running.

Launching a Docker Container

We can see there are no Docker Container and Images Present.

  • 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>”

We can see our container OS Build Info.

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”

We can see Web Service is Working Great.

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>”

We can see our code is working.

For Github Link, click here.

Done with the help of:
- Arunava Mitra
- Tejas Sanghai

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introducing GDG DevFest Ukraine 2018!

Directories Pro v1.3.87 (+Addons) — WordPress Directory Plugin

How to approach graphs in coding algori

minerstat mining tutorial #39: Profit switch with Blackminer F1 FPGAs

PSD To WordPress Conversion — Get A Responsive And Interactive WordPress Site

Generating Machine Learning Image Models from Flickr and Google Quick Draw sketches

4 Common Problems Distributed Teams Face and How To Solve Them

Woman working on laptop on sidewalk

ONE COMMAND set-up for Scala development

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
Karan Agrawal

Karan Agrawal

More from Medium

Slack Incoming Webhooks using Python

Python queries to work with multiple instances of Oracle and SQL Server.

Alerting using SMTP

How to get started with GRIB2 weather data and Python