I hardly know her!
or:
wtf is a container??
Like a virtual machine, BUT…
As opposed to one kernel for every traditional VM
This makes the docker ecosystem more lightweight
An image might be a linux distro, or a webserver, or a database, or some sort of development environement, or even…
docker itself
Images are defined in a Dockerfile, which specifies a base image to build off of, commands to run to set things up, etc.
Containers are the actual VM-like processes that you run on a computer
They are based on images, and you start them with
`docker run …`
`docker run –rm -it tiagoad/suicide-linux` [https://hub.docker.com/r/tiagoad/suicide-linux/]
- docker - A runtime for containers
- run - Run a command in a new container
- –rm - Automatically remove the container when it exits
- -it - interactive tty, as in you can access the shell
- tiagoad/suicide-linux - a docker image from hub.docker.com
$ docker run –rm -v ~/org/:/usr/share/nginx/html:ro -p 3000:80 -d nginx
- -v allows sharing directories from the host to the container (in this case my ~/org/ gets mounted at /usr/share/nginx/html)
- -p allow mapping a host port to a container port (so the container’s port 80 gets sent to my port 3000)