TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Do I need to containerize my Go service?

1 点作者 ingvul大约 4 年前
I have a Go service (it&#x27;s a simple CRUD web server) that I want to deploy to one of my Digital Ocean droplets. My idea was to have mainly two things in my droplet: nginx, and a single binary (my Go service). The binary would be built in our CI pipeline.<p>Now, my colleague says that it would be better to deploy a Docker container (the image would be built in our CI pipeline). We do containerize PHP and Python apps (and I see the value of doing it), but I just don&#x27;t see the added value of deploying Docker containers for Go apps in production (I think it even introduces a small performance penalty, since the Go binary wouldn&#x27;t be running &quot;bare metal&quot; in my droplet).

1 comment

papaf大约 4 年前
Personally I don&#x27;t use Docker containers for Go applications, but there is nothing wrong with putting everything in Docker for consistency. Most projects I know use Docker, even when its not needed, just for the consistency.<p>One minimal Docker option with Go is to use a &quot;distroless&quot; Docker image: <a href="https:&#x2F;&#x2F;github.com&#x2F;GoogleContainerTools&#x2F;distroless&#x2F;blob&#x2F;main&#x2F;examples&#x2F;go&#x2F;Dockerfile" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GoogleContainerTools&#x2F;distroless&#x2F;blob&#x2F;main...</a>