is a platform for developers and sysadmins to develop, deploy, and run applications with containers.
A container is launched by running an image. An image is an executable package that includes everything needed to run an application--the code, a runtime, libraries, environment variables, and configuration files.
A container runs natively on Linux and shares the kernel of the host machine with other containers. It runs a discrete process, taking no more memory than any other executable, making it lightweight.
$ docker run hello-world$ docker image ls$ git checkout b21a887$ docker build --tag=nodeapp .$ docker image ls$ docker run -p 4000:3000 nodeapp$ docker run -d -p 4000:3000 nodeapp$ docker container ls
...
$ docker container stop <container-id>version: "2"
services:
api1:
image: api1
ports:
- "4000:3000"
build:
context: .
dockerfile: Dockerfile
command: npm run start
volumes:
- .:/app
- /app/node_modules$ git checkout master
...
$ docker-compose build
...
$ docker-compose up