Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: docker


Linux Docker root and rootless modes

This article provides an in-depth analysis of the core differences between Docker in Root mode and Rootless mode. Root mode operates at the system-wide level, storing data in `/var/lib/docker`. It offers full privileges but has lower security. Rootless mode runs with regular user permissions, isolates data within the user directory, and leverages user namespace technology to enhance security and enable independent instances for multiple users. However, it is limited by CPU and I/O constraints and certain network functionalities. The article points out that because the data storage and service configurations of the two modes are completely independent, they cannot share images and containers. Based on the current actual needs, which do not require advanced features, the author decided to disable Root mode and fully adopt Rootless mode. The text details how to manage user-level services using `systemctl --user`, corrects the misconception that `systemctl` is limited to system-level usage, and compares the configuration file paths, socket locations, and storage directories in both modes. Additionally, it discusses the Rootless capabilities of applications such as Podman and Caddy, summarizes the advantages and limitations of Rootless mode in development, testing, and shared hosting scenarios, and provides a practical guide for managing containers more securely and flexibly in a Linux environment.

Views 457
AnduinOS Docker comparison-analysis configuration-management docker-containerization linux-containers rootless-docker security-best-practices

[Translation] .NET SDK Will Have Built-in Container Support, No Longer Requiring a Dockerfile

This article introduces the new container image build feature in the .NET 7 SDK, designed to resolve the issue of missing configuration files caused by inconsistencies between the traditional Dockerfile build context and the dotnet build process. By leveraging the new TAR API introduced in .NET 7, this feature generates container images directly via MSBuild properties, eliminating the need to write complex Dockerfiles. Its core advantage lies in seamless integration with existing build logic. It automatically selects a Debian-based base image by default and supports customizing the image name, version, and underlying system (such as Alpine) through properties like ContainerBaseImage. Although it currently does not support executing RUN commands, pushing to remote repositories, or creating Windows images, custom base images can be used to meet native dependency installation needs, and these features will be progressively enhanced in future versions. The article recommends trying this feature in local development or CI pipelines to simplify the containerization workflow. While Dockerfiles remain more flexible, the SDK-integrated approach offers a more convenient automated experience in specific scenarios.

Views 95
.NET .NET SDK Container Builds Docker GitHub Actions Linux x64