Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Deployment with Docker

You're reading from   Deployment with Docker Apply continuous integration models, deploy applications quicker, and scale at large by putting Docker to work

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781786469007
Length 298 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Srdjan Grubor Srdjan Grubor
Author Profile Icon Srdjan Grubor
Srdjan Grubor
Arrow right icon
View More author details
Toc

Service from scratch

Our last example was decently comprehensive but it left out some important Docker commands that we should also know, so we will use another example, albeit reworking the web server solution in a slightly less optimal way, to both show them used and to explain what they do. In the process, we will go a bit deeper and see whether we can make as many parts of the service on our own.

We will start this example with creating a clean directory and creating the same test file we used earlier:

$ mkdir ~/python_webserver
$ cd ~/python_webserver

$ echo "Just a test file" > test.txt

Now we will create our bit-more-complex Python-based web server container by putting the following content in the Dockerfile:

FROM python:3

# Add some labels for cache busting and annotating
LABEL version="1.0"
LABEL org.sgnn7.name="python-webserver"

...
You have been reading a chapter from
Deployment with Docker
Published in: Nov 2017
Publisher: Packt
ISBN-13: 9781786469007
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime