Container

A container is a process. A container may have more than one process running inside. But it is usually one process. The command to start it is defined in the dockerfile or other configurarion. The container that is a server runs for ever. A container that has only fixed amount of code stops. The image of a container contains all files and binaries. There is a current directory to which files are copies. Anything inside the container has its own filesystem and cannot access anything else. Like how any process can listen to a port it can request from the OS, a container process can also request port. The container definition must define ports exposed. While running a container, while starting, the port mapping to the operating system has to be made. Also parts of the filesystem in the OS, can be mounted to any part of the container. Containers can access only the binaries it has access to. Since most docker containers are based on ububtu a lot of libraries are provided. The layering allows image to be small since lot of binaries can be shared. The layering is there only to share files. So we have to put our own files on the top only. Can we start a container from a dockerfile without creating an image? Docker is there only to run the containers. All the cloud management is done by orchestrator. The docker compose or k8s uses docker to just start the container from an image or pull an image. When you deploy a kubernetes application, it simply connects with its clients on the machines which talk with docker to create components and check on components