by Rob Richardson
Rob Richardson is a software craftsman building web properties in ASP.NET and Node, React and Vue. He's a frequent speaker at conferences, user groups, and community events, and a diligent teacher and student of high quality software development. You can find this and other talks on https://robrich.org/presentations and follow him on twitter at @rob_rich.
DEMO:
Hello Docker
"Docker: VM++"
ideal platform for dev & ops
ideal platform for dev & ops
Docker is an ecosystem around Container Virtualization
Light-weight kernel virtualization
A suite of command-line tools for creating, running, and managing containers
Source: http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/
Containers virtualize and share the host kernel
Containers must run on the kernel for which they were built:
Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf
FROM node
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
ENV NODE_ENV production
ENV PORT 3000
EXPOSE 3000
CMD ["npm", "start"]
Source: https://docs.docker.com/engine/userguide/storagedriver/aufs-driver/
Only downloads each layer to disk once
because layers don't change
Volumes are a pointer in the container
saved to a folder on the host
In Dockerfile:
VOLUME ["/data"]
Starting container
docker run -v $(pwd):/data imagename
Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf
DEMO:
Craft Dockefile, build image, run container
WAN | → | LAN |
---|---|---|
localhost:80 | → | 172.17.0.2:80 |
localhost:81 | → | 172.17.0.3:80 |
localhost:82 | → | 172.17.0.4:80 |
Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf
Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf
version: '3'
services:
web:
build: .
ports:
- "80:5000"
volumes:
- logvolume01:/var/log
links:
- redis
redis:
image: redis
volumes:
logvolume01: {}
Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf