Urgent.News

What's breaking now, across thousands of outlets.

Tech

A container in 81 lines of Bash: what the kernel primitives cost on Ubuntu 24.04

Early in this lab I had a shell that was PID 1, and from that same shell ps listed systemd as PID 1. Both were right. The kernel had put the shell in a new PID namespace; ps was still reading a /proc mounted for the host. Isolation and what the tools report are two different things, and that gap is where most container debugging happens. This is the first post in a series about building AI…

This article details the construction of a container using only kernel primitives in a Bash script, written for Ubuntu 24.04. The author, who is transitioning back to infrastructure work, starts from scratch to build a container, documenting each step and the resulting measurements. The container is built using namespaces, cgroups, a root filesystem, and a virtual network cable. The author performs six checks to ensure proper isolation and functionality:

1. The shell is PID 1 and ps only lists container processes.

2. The hostname inside the container differs from the host, and ls / reveals Alpine rather than the host OS.

3. A process exceeding memory limits is killed, and oom_kill 1 is recorded in memory.events.

4. Ping from the container to the host works over a veth pair.

5. lsns shows distinct namespace inodes for the container.

6. The script cleans up after itself, removing any leftover resources.

The author uses Alpine minirootfs 3.24.2, a 3.7 MB tarball extracted to 8.7 MB. They verify integrity with a checksum and leave a GPG signature for future labs. The script covers UTS namespace (hostname isolation), PID namespace (fork flag importance), and mounting filesystems. The results show distinct namespace inodes for the container and demonstrate that the host filesystem remains intact outside the container.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

遇到API调用问题?常见错误代码与排查手册

引言 在开发过程中,API 调用是连接前后端、第三方服务与业务逻辑的桥梁。然而,接口报错几乎是每位开发者都会遇到的日常挑战。面对形形色色的错误代码,如果缺乏系统的排查思路,往往会在定位问题上耗费大量时间。本文整理了一份常见 API 错误代码的排查手册,帮助你快速识别问题根源,并给出对应的解决思路。 错误代码分类概览 API 错误代码通常遵循 HTTP…

I Turned My GitHub Profile Into a Dark Souls-Inspired RPG Character Sheet ⚔️

What if your GitHub profile looked less like a developer résumé and more like a character screen from Dark Souls? That was the idea behind my latest GitHub profile redesign.

  • GitHub profile redesigned as Dark Souls character sheet
  • RPG-style health and stamina display for technical skills
  • Custom SVG banners, bonfire visuals, and animated contributions

More from Monday 12 October →