Skip to content

Building docker images fails on non-Windows machine #7

@Jandev

Description

@Jandev

Running the azd up on my machine and the following error is thrown during the provisioning step.

Building Docker image locally...
#0 building with "orbstack" instance using docker driver

#1 [internal] load build definition from .\deployment\docker\frontend.Dockerfile
#1 transferring dockerfile:
#1 transferring dockerfile: 2B 0.7s done
#1 DONE 0.7s
ERROR: failed to build: failed to solve: failed to read dockerfile: open .\deployment\docker\frontend.Dockerfile: no such file or directory
, stderr: Write-Error: Container deployment failed: Docker build failed

It looks like backslashes are being used for the path traversal, which does not work proper on non-Windows machines.

Solved this myself by using the Powershell functionality for this, like so:

$dockerfilePath = Join-Path "deployment" "docker" "frontend.Dockerfile"
docker build `
    --build-arg ENTRA_SPA_CLIENT_ID=$ClientId `
    --build-arg ENTRA_TENANT_ID=$TenantId `
    -f $dockerfilePath `
    -t $imageName `
    . 2>&1 | Out-Host

and also on all other areas where this occurs

The Docker build now appears to be invoked proper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions