Skip to content

Docker for Devs talk for Full Stack Hants on 12 March 2018

Notifications You must be signed in to change notification settings

davidcurrie/fsh-march-2018

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Docker for Developers

Talk given at Full Stack Hants on 12 March 2018.

Basics of Docker

Introducing namespaces, control groups, the union file system and many of the basic commands.

uname -r
cat /etc/*release
whoami
ps aux
ls /home
hostname
docker version
docker search ubuntu
open http://hub.docker.com/
docker pull ubuntu
docker images ubuntu
docker run ubuntu echo "Hello World"
docker ps
docker ps -a
docker rm <ID>
docker run -it --rm ubuntu
uname -r
cat /etc/*release
whoami
ls /home
ps aux
hostname
sleep 321
Ctrl-p-q
ps aux | grep 321
docker attach <ID>
Ctrl-c
touch hello.txt
Ctrl-p-q
sudo find /var/lib -name "hello.txt"
sudo ls /var/lib/..../diff/....
sudo ls /var/lib/..../merged/...
docker logs <ID>
docker diff <ID>
docker commit <ID> touched
docker stop <ID>
docker images
docker history touched
docker run -it --rm touched
ls
Ctrl-c
docker run -d --name stress progrium/stress --cpu 2
docker stats
docker kill stress
docker rm stress
docker run -d --name stress progrium/stress --cpu 2
docker stats
docker rm -f stress

Working with Docker images

cd flask
view Dockerfile
docker build -t flask .
docker run -d -p 5000:5000 --name flask flask
docker logs flask
open http://localhost:5000
docker rm -f flask
vi demo.py
[Edit string]
docker build -t flask .
docker run -d -p 5000:5000 --name flask flask
docker logs flask
[Refresh browser]
docker rm -f flask
docker run -d -v $(pwd):/app -p 5000:5000 --name flask flask
vi demo.py
[Edit string]
[Refresh browser]
docker rm -f flask
docker tag flask dcurrie/flask
docker push dcurrie/flask
docker rmi flask dcurrie/flask
docker run -d -p 5000:5000 --name flask dcurrie/flask
docker rm -f flask

Docker Compose

cd ../flask-mongo
view docker-compose.yml
docker-compose up

Multi-stage Builds

cd ../golang
view Dockerfile
docker build -t gohello .
docker run -dP gohello
docker port <ID>
open http://localhost:<PORT>
docker images gohello

Further topics

About

Docker for Devs talk for Full Stack Hants on 12 March 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published