Skip to content

Containerization

stachu edited this page Jan 22, 2018 · 19 revisions

Containerization

Both the host and container share the same kernel.
Engine responsible for providing the execution environment for application is called virtualization container.

Solutions

LXC

Container's filesystem root location: /var/lib/lxc/<container name>
Container creation scripts/templates for given distro: /usr/share/lxc/templates

To verify if LXC is supported on current OS/kernel run: lxc-checkconfig

Debian may have some issues with memory control via cgroups.
Check kernel support: cat /boot/config-$(uname -r) | grep CONFIG_MEMCG
If output contains both CONFIG_MEMCG=y and CONFIG_MEMCG_DISABLED=y means that memory cgroups must be explicitly enabled by kernel parameter (cgroup_enable=memory)

Networking

Bridge network on host OS.

Docker

LXC-based, widespread.

Vocabulary

term meaning
image
container

Push image:

  1. Tag image first with repository URL
    docker tag <image> <repourl>/<tag>
  2. Login to desired repository, docker.io is the default
    docker login <repourl>
  3. docker push <repourl>/<tag>

References

  1. Modern Linux Administration - Sam R. Alapati
  2. https://wiki.debian.org/LXC
  3. https://www.stgraber.org/2013/12/20/lxc-1-0-blog-post-series/
  4. https://www.flockport.com/guides/
Clone this wiki locally