dotnet / dotnet/sdk-container-builds

DOCKER_HOST ignored

Open
#490 3 comments 0 reactions 0 assignees View on GitHub
Area: Registries enhancement
Dominant language
No language data
Stars
197
Forks
53
PR merge metrics
No merged PRs in 30d

Description

The CI Example in the Blog Post https://hub.docker.com/_/microsoft-dotnet-nightly-sdk/ relies on an `ubuntu-latest` base image to run the build and uses the `actions/setup-dotnet@v2` to setup the .NET SDK. After that the dotnet-sdk starts a local docker daemon to run the build.

On GitLab-CI we typically do this by running one or multiple "service" containers beside the buildstep, which can be reached via network.. In this case the docker:24-dind container (docker in docker).

Typically if you run a normal docker build you would set `DOCKER_HOST` environment variable to the hostname of the service container and the docker cli binary would talk to that docker daemon..

However the .NET SDK does not seem to care about the DOCKER_HOST environment variable, but tries to start a docker daemon locally nevertheless:

```
/root/.nuget/packages/microsoft.net.build.containers/7.0.400/build/Microsoft.NET.Build.Containers.targets(201,5): error CONTAINER1012: The local Docker daemon is not available, but pushing to a local Docker daemon was requested. Please start the daemon and try again. [/builds/my/project.csproj]
```

Would be cool, if the `Microsoft.NET.Build.Containers` honors the DOCKER_HOST environment variable..

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Microsoft.NET.Build.Containers.targets path shown in the error and the linked CI example. Reproduce the build with a GitLab CI docker:24-dind service and DOCKER_HOST set to that service, then verify that the SDK uses the configured daemon instead of requiring a local daemon.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, gitlab
Domain
build-system, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.