Skip to content

fix: honor standard Docker host environment - #320

Open
Eljees wants to merge 1 commit into
goodwithtech:masterfrom
Eljees:agent/honor-docker-host-env
Open

fix: honor standard Docker host environment#320
Eljees wants to merge 1 commit into
goodwithtech:masterfrom
Eljees:agent/honor-docker-host-env

Conversation

@Eljees

@Eljees Eljees commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • accept the standard DOCKER_HOST environment variable as a source for Dockle's daemon host option
  • preserve the existing precedence of explicit --host and DOCKLE_HOST
  • add table-driven coverage for CLI, both environment variables, XDG, and default socket selection

Root cause

The documented GitLab Docker-in-Docker setup exports DOCKER_HOST=tcp://docker:2375 for Docker clients. Dockle only read DOCKLE_HOST and otherwise forced unix:///var/run/docker.sock, so it could not see the locally built image and fell back to an unauthorized Docker Hub lookup.

Testing

  • CGO_ENABLED=0 go test ./pkg -count=1
  • CGO_ENABLED=0 go vet ./pkg

Fixes #263

Signed-off-by: Eljees <3.14hell@gmail.com>
@Eljees
Eljees force-pushed the agent/honor-docker-host-env branch from 80ed724 to cacd6e2 Compare July 29, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockle Error while scanning an Image built on a Gitlab SaaS Runner

1 participant