⬅️ FEM Docker
- Docker is a command line tool that makes creating, updating packaging, distributing, and running containers significantly easier
- it creates a new environment that’s isolated by namespace and limited by cgroups and chroot’ing you into it
🤔 What is Docker Hub?
Docker Hub is a public registry of pre-made containers (it’s like npm for containers)
docker pull mongo:3
- will pull the mongo image
🤔 What are images?
- a blueprint that contains the instructions to build a container. It’s an immutable snapshot of the file system and configuration of an application. Images can be easily shared between developers.
You can use images to build other images and build on the work of others
🤔 And what are containers?
- A container is a executable package that contains everything needed to run an application. It will always run the same, regardless of infrastructure, in a sandboxed environment. It is a running instance of an image.
So, first you build an image, then you run a container.
🤔 How do you print out currently running containers?
🤔 And how do you kill it?
You can name your container:
🤔 How to free up unused docker space?
🤔 How do you automatically cleanup the container?
🤔 How to run a container that comes with node?
🤔 Run it and get dropped in bash?
🤔 What is the difference between docker run
and docker exec
?
docker run
will start a new containerdocker exec
runs the command in an already-running container