-
A stand-alone executable package that contains:
- Code
- Runtime
- System tools
- Libraries
- Settings
-
Isolates software from its surroundings
- Some examples:
- Processes
- File system
- Shared memory
- Network
- Resource (CPU etc.)
- A container platform
- A set of tools
- A client and a daemon
- Other options (rkt, clearcontainer etc.)
- An image is a snapshot of the filesystem
- Used to run a container
- Example Dockerfile
FROM alpine
RUN apk update && apk add nodejs
- Build the image
docker image build -t tr/presentation .
docker container run -it --rm \
tr/presentation node
docker image pull node
- Review the files in the repo, js source & Dockerfile
- Build the image
docker image build -t \
travelrepublic/presentation-docker-node
- Run the container
docker container run -it --rm \
-p 9000:8080 \
-e ENVIRONMENT=test \
travelrepublic/presentation-docker-node
- Review the .travis.yml file
- Change the node version to node:6 and push to the repository
- Keep an eye on travis, pull the newly built image and run locally