Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to escape working directory with cwd:// for remote plaintext Bake definitions #2697

Open
3 tasks done
dvdksn opened this issue Sep 13, 2024 · 0 comments
Open
3 tasks done

Comments

@dvdksn
Copy link
Contributor

dvdksn commented Sep 13, 2024

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Bake should error out if you try to escape the current working directory in a remote Bake definition. This validation only occurs for remote Bake files in Git. For remote plaintext files, no validation occurs.

Expected behaviour

ERROR: path /private/tmp is outside of the working directory, please set BAKE_ALLOW_REMOTE_FS_ACCESS=1

Actual behaviour

It copies the files fine.

Buildx version

github.com/docker/buildx 056cf8a 056cf8a

Docker info

No response

Builders list

Name:          container
Driver:        docker-container
Last Activity: 2024-09-13 13:46:41 +0000 UTC

Nodes:
Name:                  container0
Endpoint:              desktop-linux
Driver Options:        default-load="true" image="moby/buildkit:master"
Status:                running
BuildKit daemon flags: --allow-insecure-entitlement=network.host
BuildKit version:      3a70550

Configuration

target "default" {
  context = "cwd:///tmp"
  dockerfile-inline = <<EOT
FROM alpine
WORKDIR /src
COPY . .
RUN ls -l && stop
EOT
}

target "named" {
  contexts = {
    tmp = "cwd:///tmp"
  }
  dockerfile-inline = <<EOT
FROM alpine
WORKDIR /src
COPY --from=tmp . .
RUN ls -l && stop
EOT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant