A standardized unit of software
For Windows / Mac Users;
Install GuideFor (most) Linux Users;
curl -sSL https://get.docker.com/ | sh
For Arch users; it's in the community repo so just install it with whatever it is you use
Once you have it installed;
docker run hello-world
should contain the following output;
Hello from Docker!
This message shows that your installation appears to be working correctly.
In the output of the last command I gave you, you might have seen something like this;
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
This is Docker saying
"I don't have the 'hello-world' image on this machine, let me go get it"
If only there was some kind of website where people could upload Docker images for various widely used applications...
techtalks-flaskflask
# Base image is the python 3.7 docker image
FROM python:3.7
# Set the working directory inside the image
WORKDIR /home/freyamade/public_html
# Copy from the build context to the image
COPY . .
# Install requirements
RUN pip install -r requirements.txt
# Load the latest submodules
RUN git submodule init
RUN git submodule update --remote
# Expose port 5000
EXPOSE 5000
# Set the entrypoint (CMD also works here)
ENTRYPOINT python3.7 app.py
docker build -t techtalks-flask .
docker images
docker run -p 5000:5000 -d techtalks-flask
# show running containers
docker ps
# show all containers, dead or alive
docker ps -a
Before I spill some company secrets, I want to share a couple of other cool things with you
-vdocker run -p 5000:5000 -v $(pwd):/home/freyamade/public_html -d freyamade
templates/index.html, reload the page and you'll see it update in real time!
-v + web development
# Run from inside project directory, then go to localhost:8080
docker run -v $(pwd):/usr/local/apache2/htdocs/ -p 8080:80 -d httpd
techtalks-flask + ComposeLet's say I add some reason to use redis in the techtalks-flask project.
I could have the following compose file;
version: '3'
services:
web:
image: "techtalks-flask"
ports:
- "5000:5000"
redis:
image: "redis:alpine"
And then bring up both images using;
docker-compose up -d
Kubernetes (k8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
fabric
git fetch origin, and git reset --hard <branch>
FROM docker-talk:audience
RUN answer-questions.sh