Debug docker image size is ridiculous. #846

Closed
opened 2025-12-29 02:24:46 +01:00 by adam · 2 comments
Owner

Originally created by @sevenrats on GitHub (Nov 1, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The new "unofficial" image is 2.5 gigabytes due to non-standard approaches in "Dockerfile.debug"

Expected Behavior

Just do normal docker best-practices.

Steps To Reproduce

Build your dockerfile, its huge.

Environment

Debian Bookworm,
.23
NA

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

No response

Originally created by @sevenrats on GitHub (Nov 1, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior The new "unofficial" image is 2.5 gigabytes due to non-standard approaches in "Dockerfile.debug" ### Expected Behavior Just do normal docker best-practices. ### Steps To Reproduce Build your dockerfile, its huge. ### Environment ```markdown Debian Bookworm, .23 NA ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:24:46 +01:00
adam closed this issue 2025-12-29 02:24:46 +01:00
Author
Owner

@sevenrats commented on GitHub (Nov 1, 2024):

wontfix
https://github.com/juanfont/headscale/pull/2221#issuecomment-2452237213

@sevenrats commented on GitHub (Nov 1, 2024): wontfix https://github.com/juanfont/headscale/pull/2221#issuecomment-2452237213
Author
Owner

@yqs112358 commented on GitHub (Nov 8, 2024):

You can use ko to build normal docker images and publish it to your own docker hub for use. Something like:

export CGO_ENABLED=0
export GOFLAGS='-mod=readonly'
export GOBUILD_FLAGS="-ldflags=-s -w"
export KO_DOCKER_REPO=docker.io/YOUR-USERNAME/headscale-test
export KO_DEFAULTBASEIMAGE=gcr.io/distroless/base-debian12

ko publish --bare ./cmd/headscale
@yqs112358 commented on GitHub (Nov 8, 2024): You can use `ko` to build normal docker images and publish it to your own docker hub for use. Something like: ``` export CGO_ENABLED=0 export GOFLAGS='-mod=readonly' export GOBUILD_FLAGS="-ldflags=-s -w" export KO_DOCKER_REPO=docker.io/YOUR-USERNAME/headscale-test export KO_DEFAULTBASEIMAGE=gcr.io/distroless/base-debian12 ko publish --bare ./cmd/headscale ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#846