-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
wangb edited this page Apr 24, 2018
·
1 revision
- Image
- is a special filesystem
- layer structure
- Container
- running instance
- layer structure
- lost storage while container is stopped or closed
- Volume: data persistent
- Repository
- get images from docker registry:
docker pull repo
- run an image:
docker run repo
- list images:
docker image ls
- delete images:
docker image rm
- commit changes on container to new image:
docker diff
,docker commit
- customize:
docker build
builds an image from aDockerfile
and acontext
- FROM: base image
- RUN: each directive create a new commit
- COPY, ADD: copy file from context,
ADD
is more advance version ofCOPY
- CMD: run the container process. Once the process exit, container stop.
- VOLUME: define anyonmouse volume mount point
- EXPOSE: expose container port to host
- create a volume:
docker volume create
- mount a volume:
--mount
Defining and running multi-container Docker applications