GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Workdir does not work or is not documented properly · Issue #294 · docker/bake-action

Workdir does not work or is not documented properly #294

New issue
Copy link
New issue
Copy link
Closed
#365
Closed
Workdir does not work or is not documented properly#294
#365
Copy link

Description

@Clashsoft
Clashsoft
opened on Jan 22, 2025
Issue body actions

Contributing guidelines

  • I've read the contributing guidelines and wholeheartedly agree

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

Activity

  1. Clashsoft
    added
    status/triage
    on Jan 22, 2025
  2. crazy-max commented on Jan 22, 2025

    @crazy-max
    crazy-max
    on Jan 22, 2025
    Member
    More actions

    v6 uses git context by default as explained in the release notes: https://github.com/docker/bake-action/releases/tag/v6.0.0 and therefore doesn't interact with local files by default anymore.

    You either need to:

    1. specify the subdir you want to switch to with git context in source as explained in https://github.com/docker/bake-action?tab=readme-ov-file#git-context:
            uses: docker/bake-action@v6
            with:
              source: "{{defaultContext}}:projects"
              files: docker-compose.base.yaml
              push: true
    1. Or you can keep using local files by specifying source: .:
            uses: docker/bake-action@v6
            with:
              source: .
              workdir: projects/
              files: docker-compose.base.yaml
              push: true

    If you want to use option 1), then you can remove the Checkout step as BuildKit will already git clone.

    Reacted by Maxime Steinhausser
  3. crazy-max
    removed
    status/triage
    on Jan 22, 2025
  4. Clashsoft commented on Jan 22, 2025

    @Clashsoft
    Clashsoft
    on Jan 22, 2025
    Author
    More actions

    Thanks, that did work!

  5. Clashsoft
    closed this as completedon Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.