Linux Containers (LXC)
LXC is an OS-level virtulization method,
combining the single host kernel cgroups
to provide isolated environments for applications,
allowing running multiple isolated Linux systems (the containers).
The cgroups functionality provides limitation
and prioritization of resources (CPU, memory, block I/O, network, etc.)
and namespace isolation (process trees, network, user IDs and mounted FS).
Writing Dockerfiles
In a directory, the special Dockerfile defines a receipe to build the image,
as a succession of instructions defining a step in the build process.
The FROM instruction targets a base image to use as prior,
a common linux distribution for this is Alpine. Version can be specified after colon,
for example: FROM alpine:3.14.
The ADD
and COPY instructions are closely related,
can often be changed interchangeably, the former providing additional remote fetching capabilities,
the latter to be preferred for straight-forward host-to-image file transfer.
The ENTRYPOINT instruction specifies binaries to execute afterwards.
A common value is ENTRYPOINT ["/bin/sh"], to open
a shell immediately in the container.