DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Josue Luzardo Gebrim
Josue Luzardo Gebrim

Posted on

The World Beyond the Docker! $$ :)

Containers with Podman, LXC, ContainerD, kaniko

his publication accumulates some options for creating and executing containers that can be used instead of Docker, which, unfortunately, became a paid solution for most companies that used it.

image.png

Installing:

# Ubuntu 20.10 and newer
sudo apt-get -y update
sudo apt-get -y install podman
Enter fullscreen mode Exit fullscreen mode

Running a container:

podman run -dt -p 8080:80/tcp docker.io/library/httpd

Listing:

podman ps

image.png

LXC(Linux Containers)

LXC is a Linux-based containerization solution, making it possible to create multiple isolated Linux environments on a single Linux machine. Unlike Docker, LXC acts as a hypervisor to create multiple Linux machines with separate system files, network resources, and applications.

Despite being older, it has recently had a strong comeback by standing out over Docker’s shortcomings, including reduced disk performance, poor volume management, and sharing of host resources such as IP address, system files, hostname, etc.

Both Docker and LXC are lightweight and can be easily deployed; however, LXC can function as an alternative to hypervisors and is preferred for data-intensive applications and operations.

image.png

This is an open-source project for creating and running containers used by various projects, including Docker and typical Kubernetes configurations such as AKS, EKS, and GKE.

One of the subprojects is nerdctl, a simple docker-compatible CLI commonly used with the Lima project (LInux MAchines), Linux virtual machines with automatic file sharing, port forwarding, and containerd.

I found it simpler to use them with linuxbrew:

Installing linuxbrew:

/bin/bash -c β€œ$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Installing and running nerdctl + Lima:

brew install lima
limactl start
lima nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine
Enter fullscreen mode Exit fullscreen mode

image.png

kaniko is a tool for building container images from a Dockerfile, inside a Kubernetes container or cluster.

This was the open-source solution mainly maintained by Google. Instead of carrying out the entire local build process, it can be easily configured to do everything in a Kubernetes cluster, from a simple deployment of an executor. This executor will do both the build, image layer caching, deployment, and registry integration.

:) Demo:

0_4r279NWAqM82x_J_.gif

Those were some happy alternatives for creating containers, and there are many others that I’m discovering; what about you? Do you use a different one?

References:

https://podman.io/

https://linuxcontainers.org/

https://rigorousthemes.com/blog/best-docker-alternatives/

https://github.com/containerd/containerd

https://medium.com/nttlabs/containerd-and-lima-39e0b64d2a59

https://github.com/GoogleContainerTools/kaniko#tutorial

Buy Me A Coffee

Follow me on Medium :)

Top comments (0)

Timeless DEV post...

Arguably the single most important piece of documentation for any open source project is the README. A good README not only informs people what the project does and who it is for but also how they use and contribute to it.

How to write a kickass README