Full-stack Web Technologies

CHAPTER 3
Containers

Portable Applications

  • Containers are a way to package an application with all its dependencies. (Much easier to install on any system.)

  • Share the kernel with the host, not VMs!

What is a container

  • An app using an image (there can be many containers using the same image).
  • Has a name and a hash.

Managing containers

  • Creation.

  • Launch (-d?).

  • Listing running containers.

  • Copying files (docker cp).

  • Stopping.

  • Deletion (rm).

  • Input/Output -it.

Running containers

  • Run = Create + Start.

  • Run Ephemeral run --rm

  • Stopping exited containers: docker container prune.

  • Logs: docker logs mycont.

  • exec -it