Skip to content

Workdir does not work or is not documented properly #294

@Clashsoft

Description

@Clashsoft

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

The workdir input either does not work or is not documented properly, because I cannot get it to work any more with v6. It used to work fine in v4.

My docker-compose is in the projects/ directory.
It references Dockerfiles in projects/base/Dockerfile.

What used to work:

        uses: docker/bake-action@v4
        with:
          push: true
          workdir: projects/
          files: docker-compose.base.yaml

What does not work:

        uses: docker/bake-action@v6
        with:
          push: true
          workdir: projects/
          files: docker-compose.base.yaml
cannot parse bake definitions: ERROR: failed to solve: lstat docker-compose.base.yaml: no such file or directory

And also:

        uses: docker/bake-action@v6
        with:
          push: true
          workdir: projects/
          files: projects/docker-compose.base.yaml
buildx bake failed with: ERROR: failed to solve: failed to read dockerfile: open base/Dockerfile: no such file or directory

And:

        uses: docker/bake-action@v6
        with:
          push: true
          source: ./projects/
          files: docker-compose.base.yaml
buildx bake failed with: ERROR: failed to solve: failed to read dockerfile: open base/Dockerfile: no such file or directory

And:

      - name: Build and push techs
        uses: docker/bake-action@v6
        with:
          push: true
          files: projects/docker-compose.techs.yaml
buildx bake failed with: ERROR: failed to solve: failed to read dockerfile: open base/Dockerfile: no such file or directory

Expected behaviour

The workdir input works.

Actual behaviour

The workdir does not work.

Repository URL

https://github.com/fujaba/fulib.org

Workflow run URL

https://github.com/fujaba/fulib.org/actions/runs/12907120787/job/35989907190

YAML workflow

name: Deploy Projects

on:
  push:
    branches:
      - master
    paths:
      - 'projects/**'
      - '.github/workflows/deploy.sh'
      - '.github/workflows/deploy-projects.yml'

concurrency:
  group: deploy-projects
  cancel-in-progress: true

jobs:
  projects-images:
    name: Projects Images
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Log in to Docker
        uses: docker/login-action@v3
        with:
          registry: ${{ secrets.DOCKER_REGISTRY }}
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: Build and push base
        uses: docker/bake-action@v6
        with:
          push: true
          files: projects/docker-compose.base.yaml
          set: |
            *.cache-to=type=gha,mode=max
            *.cache-from=type=gha
      - name: Build and push techs
        uses: docker/bake-action@v6
        with:
          push: true
          files: projects/docker-compose.techs.yaml
          set: |
            *.cache-to=type=gha,mode=max
            *.cache-from=type=gha
...

Workflow logs

Run docker/bake-action@v6
GitHub Actions runtime token ACs
Docker info
Proxy configuration
Buildx version
Builder info
Parsing raw definition
Bake definition
/usr/bin/docker buildx bake https://github.com/fujaba/fulib.org.git#0fd8f920d3ba0caadc00e331916b72e7d518204e --allow fs=* --file projects/docker-compose.base.yaml --set *.cache-to=type=gha,mode=max --set *.cache-from=type=gha --metadata-file /home/runner/work/_temp/docker-actions-toolkit-TytNC6/bake-metadata-37cf3f485b.json --provenance mode=max,builder-id=https://github.com/fujaba/fulib.org/actions/runs/12907120787/attempts/1 --push
#0 building with "builder-a578712f-7717-4df9-9257-0e34b60de468" instance using docker-container driver

#1 [internal] load git source https://github.com/fujaba/fulib.org.git#0fd8f920d3ba0caadc00e331916b72e7d518204e
#1 CACHED
ERROR: failed to solve: failed to read dockerfile: open base/Dockerfile: no such file or directory
Build references
Check build summary support
Error: buildx bake failed with: ERROR: failed to solve: failed to read dockerfile: open base/Dockerfile: no such file or directory

BuildKit logs


Additional info

No response

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