<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevOps on Commentary of Takao</title><link>https://takao.blog/zh-tw/tags/devops/</link><description>Recent content in DevOps on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Commentary of Takao</copyright><lastBuildDate>Wed, 15 Jul 2026 22:01:08 +0900</lastBuildDate><atom:link href="https://takao.blog/zh-tw/tags/devops/index.xml" rel="self" type="application/rss+xml"/><item><title>為開發和生產設計可重複使用的 Docker Compose 配置</title><link>https://takao.blog/zh-tw/web/docker-compose-production-best-practice/</link><pubDate>Mon, 20 Apr 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/docker-compose-production-best-practice/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/docker-compose-production-best-practice-zh-tw.png" alt="Featured image of post 為開發和生產設計可重複使用的 Docker Compose 配置" /&gt;&lt;h2 id="為開發和生產設計可重複使用的-docker-compose-配置"&gt;為開發和生產設計可重複使用的 Docker Compose 配置
&lt;/h2&gt;&lt;p&gt;Docker Compose 是用於定義和運行多容器應用程式的標準工具。但許多團隊去年陷入了為開發、登台和生產維護單獨的 &lt;code&gt;docker-compose.yml&lt;/code&gt; 文件的陷阱 - 導致重複、漂移和配置錯誤。&lt;/p&gt;</description></item><item><title>透過 actions/cache 加速 GitHub Actions 工作流程</title><link>https://takao.blog/zh-tw/web/github-actions-caching-setup/</link><pubDate>Thu, 20 Nov 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/github-actions-caching-setup/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/github-actions-caching-setup-zh-tw.png" alt="Featured image of post 透過 actions/cache 加速 GitHub Actions 工作流程" /&gt;&lt;p&gt;自動化 CI/CD 管道（如 GitHub Actions）是現代軟體品質控制的基石。但是，如果您的工作流程在每個拉取請求上獲取外部套件、啟動容器環境並從頭開始重建整個應用程序，則執行時間可能會迅速增加到幾分鐘。&lt;/p&gt;</description></item><item><title>透過多階段建置減少 Docker 映像大小</title><link>https://takao.blog/zh-tw/web/docker-multi-stage-build-reduction/</link><pubDate>Thu, 20 Mar 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/docker-multi-stage-build-reduction/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/docker-multi-stage-build-reduction-zh-tw.png" alt="Featured image of post 透過多階段建置減少 Docker 映像大小" /&gt;&lt;h2 id="介紹"&gt;介紹
&lt;/h2&gt;&lt;p&gt;保持 Docker 映像佔用空間較小對於加速部署週期、降低儲存成本以及透過縮小容器的攻擊面來加強安全性至關重要。&lt;/p&gt;
&lt;p&gt;然而，簡單的 Dockerfile 建構通常會將編譯時相依性（如 gcc、標頭、建置快取）和測試工具直接捆綁到最終的執行時間映像中。這會使圖像大小從幾兆位元組膨脹到數百或千兆位元組。&lt;/p&gt;</description></item><item><title>Docker 網路：從橋接網路到覆蓋網絡</title><link>https://takao.blog/zh-tw/web/docker-networking/</link><pubDate>Tue, 27 Aug 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/docker-networking/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/docker-networking-zh-tw.png" alt="Featured image of post Docker 網路：從橋接網路到覆蓋網絡" /&gt;&lt;h2 id="介紹"&gt;介紹
&lt;/h2&gt;&lt;p&gt;Docker 容器被設計為可移植和隔離的，但它們很少單獨運行。容器需要相互通訊、與主機系統以及外部服務通訊。了解 Docker 的網路模型對於建立可靠、安全且高效能的容器化應用程式至關重要。&lt;/p&gt;</description></item><item><title>貨櫃安全掃描：保護您的供應鏈</title><link>https://takao.blog/zh-tw/web/container-security/</link><pubDate>Tue, 16 Jul 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/container-security/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/container-security-zh-tw.png" alt="Featured image of post 貨櫃安全掃描：保護您的供應鏈" /&gt;&lt;p&gt;容器安全不再是可選的。隨著供應鏈攻擊的增加，保護容器映像從建置到運行的整個過程是任何運行容器化工作負載的組織的基本要求。僅運行時安全是不夠的；供應鏈安全必須從形象建構階段開始。&lt;/p&gt;</description></item><item><title>GitHub Actions 進階: Workflows Beyond CI/CD 基礎</title><link>https://takao.blog/zh-tw/web/github-actions-advanced/</link><pubDate>Tue, 16 Apr 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/github-actions-advanced/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/github-actions-advanced-zh-tw.png" alt="Featured image of post GitHub Actions 進階: Workflows Beyond CI/CD 基礎" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;GitHub Actions has evolved from a simple CI/CD tool into a comprehensive automation platform. While basic workflows are well-documented, the platform&amp;rsquo;s advanced features—reusable workflows, composite actions, matrix strategies, and deployment patterns—enable sophisticated automation pipelines. This article explores these advanced capabilities for teams building complex CI/CD systems.&lt;/p&gt;</description></item><item><title>Docker Health Checks and Container Monitoring 最佳 Practices</title><link>https://takao.blog/zh-tw/web/docker-health-checks/</link><pubDate>Mon, 25 Dec 2023 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/docker-health-checks/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/docker-health-checks-zh-tw.png" alt="Featured image of post Docker Health Checks and Container Monitoring 最佳 Practices" /&gt;&lt;p&gt;Docker health checks are essential for building self-healing container infrastructure. They enable automatic detection of application failures and trigger container restarts, ensuring your services remain available. This guide covers everything from basic &lt;code&gt;HEALTHCHECK&lt;/code&gt; implementation to advanced production patterns.&lt;/p&gt;
&lt;h2 id="the-healthcheck-instruction"&gt;The HEALTHCHECK Instruction
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;HEALTHCHECK&lt;/code&gt; instruction in a Dockerfile tells Docker how to test whether a container is still working correctly:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-dockerfile" data-lang="dockerfile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;HEALTHCHECK&lt;/span&gt; --interval&lt;span style="color:#f92672"&gt;=&lt;/span&gt;30s --timeout&lt;span style="color:#f92672"&gt;=&lt;/span&gt;3s --start-period&lt;span style="color:#f92672"&gt;=&lt;/span&gt;40s --retries&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; CMD curl -f http://localhost:3000/health &lt;span style="color:#f92672"&gt;||&lt;/span&gt; exit &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Docker tracks three states: &lt;code&gt;starting&lt;/code&gt; (during the start period), &lt;code&gt;healthy&lt;/code&gt; (checks pass), and &lt;code&gt;unhealthy&lt;/code&gt; (checks fail after retries). The &lt;code&gt;--start-period&lt;/code&gt; is critical for applications with slow startup times &amp;ndash; it suppresses failures during initialization.&lt;/p&gt;</description></item></channel></rss>