Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Cannot build git sourced image on Windows dynamic worker

Open octopus-hideaki opened this issue 7 months ago • 0 comments

Severity

Sev 3

Version

2025.3

Latest Version

I could reproduce the problem in the latest build

What happened?

The Windows dynamic worker image does not have git installed in %PATH%, so it cannot build the container image from a git URL

Reproduction

  1. Create a Windows (Default) Worker Pool
  2. Create a deployment step
    • Create Run a script step
    • Select Run once on a worker (Worker Pool just created)
    • Select Runs inside a container on a worker
    • Select Build container from Git URL
  3. Run deployment
  4. Observe failure to build image

Error and Stacktrace

00:31:10   Verbose  |       docker build --force-rm -t octopus/9bc47ae1-29cb-428c-b943-862a9cc0acac:latest https://github.com/OctopusDeploy/WorkerTools.git#master:ubuntu.22.04
00:31:10   Error    |       docker : unable to prepare context: unable to find 'git': exec: "git": executable file not found in %PATH%
00:31:10   Error    |       At C:\Octopus\Tentacle\Work\foIiv9uIkiNcbIQySKFpg\Bootstrap.ps1:58 char:1
00:31:10   Error    |       + docker build --force-rm -t octopus/9bc47ae1-29cb-428c-b943-862a9cc0ac ...
00:31:10   Error    |       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:31:10   Error    |       + CategoryInfo          : NotSpecified: (unable to prepa...found in %PATH%:String) [], RemoteException
00:31:10   Error    |       + FullyQualifiedErrorId : NativeCommandError

More Information

Image

Workaround

Select Build container from an inline Dockerfile and copy the contents of the Dockerfile in the repository

octopus-hideaki avatar Jun 10 '25 00:06 octopus-hideaki