Skip to content

[Request]: Add support for bind mount in build. #933

Description

@jglogan

Feature or enhancement request details

Dockerfile:

FROM alpine:latest
RUN --mount=type=bind,source=/etc,target=/workspace /workspace/tools/bootstrap
mkdir -p tools
cat > /tools/bootstrap <<EOT
#! /bin/bash -ex
echo hello world > /etc/motd
EOT
chmod +x bootstrap
container build --file Dockerfile --tag test .

output today:

% ./build.sh
+ container build --file Dockerfile --tag test .
[+] Building 1.4s (5/5) FINISHED                                                                                                                                                                                        
 => [resolver] fetching image...docker.io/library/alpine:latest                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                  0.1s
 => => transferring context: 2B                                                                                                                                                                                    0.0s
 => [internal] load build context                                                                                                                                                                                  0.1s
 => => transferring context: 25B                                                                                                                                                                                   0.0s
 => oci-layout://docker.io/library/alpine:latest@sha256:51183f2cfa6320055da30872f211093f9ff1d3cf06f39a0bdb212314c5dc7375                                                                                           0.7s
 => => resolve docker.io/library/alpine:latest@sha256:51183f2cfa6320055da30872f211093f9ff1d3cf06f39a0bdb212314c5dc7375                                                                                             0.3s
 => => sha256:0bd713040ebbdef7247f70b0753f8fb2f410e8eb358e95af409a8412b9847d78 4.20MB / 4.20MB                                                                                                                     0.1s
 => => extracting sha256:0bd713040ebbdef7247f70b0753f8fb2f410e8eb358e95af409a8412b9847d78                                                                                                                          0.1s
 => ERROR [linux/arm64 stage-0 1/2] RUN --mount=type=bind,source=/etc,target=/workspace /workspace/tools/bootstrap                                                                                                 0.2s
------                                                                                                                                                                                                                  
 > [linux/arm64 stage-0 1/2] RUN --mount=type=bind,source=/etc,target=/workspace /workspace/tools/bootstrap:
0.144 /bin/sh: /workspace/tools/bootstrap: not found
------
Error: unknown (2): failed to solve: process "/bin/sh -c /workspace/tools/bootstrap" did not complete successfully: exit code: 127

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    facet/builder
    on Dec 5, 2025
  2. added theissue type on Dec 5, 2025
  3. changed the title [-][Request]: Add support for bind builds in build.[/-] [+][Request]: Add support for bind mount in build.[/+] on Dec 5, 2025
  4. JaewonHur commented on Jan 29, 2026

    @JaewonHur
    Contributor

    I can take a look at it!

  5. jglogan commented on Feb 5, 2026

    @jglogan
    ContributorAuthor

    Closed by #1154

  6. added a commit that references this issue on Feb 5, 2026
    fdeb1b1
  7. added a commit that references this issue on Feb 18, 2026
    61c0378
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

    facet/builder

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions