Closed okarmusk closed 3 months ago
defaults: run: working-directory: subdirectoryA
I would guess this only changes the working directory for the inline "run" steps.
From Github docs:
You can use defaults.run to provide default shell and working-directory options for all run steps in a workflow. You can also set default settings for run that are only available to a job. For more information, see jobs.
.defaults.run . You cannot use contexts or expressions in this keyword.
In that case you would need to set context: subdirectoryA
assuming you want to shift the whole context and not just use a custom Dockerfile name. Alternatively you can also use a Git path with :
separator.
@tonistiigi thank you for your response. After changing the context it works.
I was confused, because before there is a maven step what executes properly and ls
also shown the Dockerfile
.
Thank you once again.
Contributing guidelines
I've found a bug, and:
Description
I've created a github action to build my docker image with buildx. My repository uses monorepo structure and I've decided to create separate workflow based on subpath of project. Workflow runs smoothly to trying build docker image, then it crushes.
Dockerfile
is visible in subdirectory, even target build maven is, but action still logs:Just before I've added DEBUG step to display files located in working directory and
Dockerfile
is available:I tried to remove
context: .
, but results are the same.Expected behaviour
Docker image is built and pushed to registry.
Actual behaviour
Github action buildx crushes.
Repository URL
No response
Workflow run URL
No response
YAML workflow
Workflow logs
Run docker/build-push-action@v5 GitHub Actions runtime token ACs Docker info Proxy configuration Buildx version /usr/bin/docker buildx build --iidfile /home/runner/work/_temp/docker-actions-toolkit-CsABYt/iidfile --provenance mode=min,inline-only=true,builder-id=https://github.com/***/authonium/actions/runs/8333578068 --tag ***/keycloak-authonium:latest --metadata-file /home/runner/work/_temp/docker-actions-toolkit-CsABYt/metadata-file --push .
0 building with "builder-c256609a-8401-49b2-adbf-73c02af67175" instance using docker-container driver
1 [internal] load build definition from Dockerfile
1 transferring dockerfile: 2B done
1 DONE 0.0s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory Error: buildx failed with: ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
BuildKit logs
No response
Additional info
No response