VOOZH about

URL: https://thenewstack.io/tutorial-explore-container-runtimes-with-flatcar-container-linux/

⇱ Tutorial: Explore Container Runtimes with Flatcar Container Linux - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-01-15 09:14:26
Tutorial: Explore Container Runtimes with Flatcar Container Linux
feature,tutorial,
Cloud Native Ecosystem / Containers

Tutorial: Explore Container Runtimes with Flatcar Container Linux

This tutorial is the second part of a series on Flatcar Container Linux, in which we will get familiar with the container runtimes. It also introduces the concept of running a custom version of containerd runtime as a systemd unit file.
Jan 15th, 2021 9:14am by Janakiram MSV
👁 Featued image for: Tutorial: Explore Container Runtimes with Flatcar Container Linux

This tutorial is the second part of a series on Flatcar Container Linux, in which we will get familiar with the container runtimes. It also introduces the concept of running a custom version of containerd runtime as a systemd unit file.

Flatcar Linux instances can be launched in mainstream cloud platforms, including Amazon Web Services, Microsoft Azure, and Google Cloud. We will choose Equinix Metal, which gives us the flexibility to run the OS in the bare metal environment.

After signing up with Equinix Metal, we will launch a new on-demand server instance in the nearest supported region.

👁 Image

I chose the Singapore region, and the x1.small.x86 server configuration.

Next, give your instance a name, associate one of the registered SSH keys, and click on the deploy now button.

👁 Image

Within a few minutes, the server will be ready. You can track the progress in the sidebar of the console.

You can customize the instance by adding cloud-init data in YAML format.

👁 Image

Once the instance is ready, copy the IP address to SSH into it.

👁 Image

Exploring Docker Engine

Flatcar Container Linux supports all of the popular methods for running containers. We can choose to interact with the containers at a low-level, or use a higher-level orchestration engine, which is Kubernetes.

Every Flatcar Container Linux instance comes with a stable version of Docker CE and Docker CLI.

👁 Image

The Docker service gets started as soon as the Docker Socket is activated. You can find the systemd unit files, docker.service and docker.socket at /run/systemd/system directory.

If you want to run the Docker service all the time without having to wait for the socket activation, add the following to the user data. This configuration will help when you want to keep running containers with the restart attribute set to always.

systemd:
 units:
 - name: docker.socket
 enabled: false
 - name: docker.service
 enabled: true

Exploring the containerd Runtime

Flatcar Container Linux comes with the containerd CRI plugin, and Dockershim enabled by default. Let’s explore that further by downloading the crictl CLI tool.

VERSION="v1.20.0"
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-amd64.tar.gz
sudo tar zxvf crictl-$VERSION-linux-amd64.tar.gz -C /opt/bin

We copied the binary to /opt/bin since /usr/bin is a part of the read-only filesystem.

Assuming Docker service is up and running, we can connect to the Dockershim endpoint through with crictl.

sudo crictl --runtime-endpoint=unix:///run/docker/libcontainerd/docker-containerd.sock version

👁 Image

Installing and Configuring a Custom containerd Runtime

It is possible to replace default Docker and containerd runtimes with custom versions. In this example, we will run containerd 1.4.1 instead of the default version, 1.4.3.

Let’s download the containerd 1.4.1 binary and move it to /opt/bin directory.

wget https://github.com/containerd/containerd/releases/download/v1.4.1/containerd-1.4.1-linux-amd64.tar.gz
tar xvf containerd-1.4.1-linux-amd64.tar.gz && sudo mv bin/containerd /opt/bin

We will create an empty file that will act as the placeholder for the configuration.

sudo mkdir -p /etc/containerd/
sudo touch /etc/containerd/config.toml

Create a systemd unit file with the below content. We are calling this containerd141.service to avoid the conflict with the current runtime configuration.

sudo bash -c 'cat << EOF > /etc/systemd/system/containerd141.service
[Unit]
Description=containerd container runtime
After=network.target

[Service]
Environment=CONTAINERD_CONFIG=/etc/containerd/config.toml
Environment=PATH=/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=
ExecStart=/opt/bin/containerd --config /etc/containerd/config.toml
KillMode=process
Restart=always
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity

[Install]
WantedBy=multi-user.target
EOF'

Before activating this, let’s stop Docker and container containerd services.

sudo systemctl stop docker
sudo systemctl stop containerd

Let’s activate the containerd 1.4.1 service.

sudo systemctl enable /etc/systemd/system/containerd141.service
sudo systemctl start containerd141

We can now test the version of the runtime with the crictl tool.

sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock version

Notice that we are using the native socket of containerd instead of the Dockershim.

👁 Image

To initialize a custom version of containerd during the boot process, we can embed it in the Ignition file’s configuration, which we will explore in the next part of the series. Stay tuned.

Janakiram MSV’s Webinar series, “Machine Intelligence and Modern Infrastructure (MI2),” offers informative and insightful sessions covering cutting-edge technologies. Sign up for the upcoming MI2 webinar at http://mi2.live.

Feature image by Russ Ward on Unsplash.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Unit, Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.