Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: container


Say Goodbye to Ugly Tag Suffixes: Building True Multi-Architecture Images with Docker Buildx

This article provides a comprehensive guide to building dual-architecture images for x86 and ARM64 using Docker buildx and QEMU. It begins with the installation of the base environment and the initialization of the builder, explaining how the `binfmt_misc` mechanism enables cross-platform instruction translation, allowing x86 machines to compile ARM code. The core practical section demonstrates how to use the `--platform` parameter to build multi-architecture images in one step, and explains the Manifest List principle: the builder independently compiles images for each architecture and then generates an index, ensuring that clients only download the layers corresponding to their specific architecture upon pull, thereby avoiding redundancy. The article specifically points out that multi-architecture images cannot be directly loaded into the traditional Docker local image list, recommending direct pushing or exporting in OCI format. For CI/CD scenarios, it recommends injecting QEMU support non-invasively by running the `tonistiigi/binfmt` container to keep the environment clean. Additionally, it covers verifying images using `regctl`, testing ARM images on x86 systems, a guide to avoiding common pitfalls regarding Dockerfile architecture compatibility, and an explanation of the purpose of buildx's background BuildKit containers and their resource management. Mastering these techniques enables efficient building and management of enterprise-level multi-architecture automated release pipelines.

Views 229
ARM64 Container Docker Docker Buildx Linux Multi Arch bash

Some quick Docker tips

Common Docker Tips and Tricks The following are some useful Docker commands and techniques that can help you manage your containers and images more effectively. Each section includes explanations of when and how to use these commands. Build an Image from a Dockerfile bash docker ...

Views 549
Container Docker Linux Locale bash timezone

Web Application Development Checklist

This document comprehensively outlines the best practices framework for building highly available, secure, and efficient web services. At the security level, it emphasizes enabling modern encryption protocols such as TLS 1.3, HSTS, and OCSP Stapling, and strictly configuring CSP, Rate Limiting, and firewall rules to defend against XSS, DDoS, and brute-force attacks. In terms of network and system configuration, it recommends optimizing TCP congestion control algorithms, minimizing port exposure, disabling root password login, and reducing risks through SELinux and file permission controls. From an operations perspective, it is necessary to establish robust monitoring and alerting, snapshot backup, and automated scaling mechanisms to ensure rapid recovery of business continuity during failures or traffic spikes. In the DevOps workflow, static code analysis, unit testing, and containerized deployment should be integrated via CI/CD pipelines, leveraging Docker and Kubernetes for flexible scaling. The core of application development lies in eliminating underlying defects such as memory leaks, deadlocks, and SQL injection to ensure code quality. Additionally, attention must be paid to user experience, including responsive layout, multi-language and timezone support, and PWA compatibility, while strictly adhering to global and local compliance requirements such as GDPR and the Personal Information Protection Law, thereby achieving dual assurance of technical architecture and business value.

Views 480
Cloud Container Development Linux Server Service Web

Build your home data center using Docker Swarm Mode!

This article provides a detailed overview of the complete process and core concepts for building a Docker Swarm cluster. First, by configuring hostnames, installing Docker, and initializing the Swarm cluster, it addresses Overlay Network compatibility issues in vSphere environments, successfully establishing a highly available architecture with either one manager and two workers or all managers. Next, it deploys the open-source graphical interface Swarmpit for intuitive cluster state management and provides an in-depth analysis of the hierarchical relationships and interaction logic among Stack, Service, Task, Node, Volume, and Network. The article offers command-line management tips for these core resources, including deployment, monitoring, log viewing, and node maintenance operations. Finally, it demonstrates how to quickly deploy real-world business applications using YAML files, introduces solutions for implementing automated HTTPS with Caddy and building shared storage with GlusterFS, and provides a Systemd service script to ensure nodes automatically come online after a reboot, offering comprehensive and practical guidance for container orchestration in production environments.

Views 608
Cluster Container Docker Docker Swarm Linux Server Swarmpit bash

Deploy a standalone Docker application on the server

This article provides a detailed overview of the complete process and best practices for deploying and managing Docker containers in a virtual machine. First, it guides users on configuring GPG keys to support the Pass password manager and setting up Docker credential storage to enable passwordless login for Docker Desktop. Second, it emphasizes the planning of persistent container volumes, highlighting the importance of mounting host directories to ensure data consistency and sharing. It also provides configuration references for commonly used containers and scripts for running them as non-root users. Additionally, the article explains port mapping, using restart policies to ensure containers start automatically with the host, and safely upgrading containers by deleting and recreating them. For scenarios involving multiple container dependencies, it recommends using Docker Compose to define service networks and volumes, combined with systemd for automated management. Finally, the article summarizes the need to manage the VM and containers separately in hybrid deployments and suggests a gradual transition to a containerized architecture to ensure system stability and maintainability.

Views 337
Container Docker Linux Ubuntu VM bash