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

finch build fails on '#syntax' directive in Dockerfile #170

Closed
vsiravar opened this issue Jan 18, 2023 · 3 comments
Closed

finch build fails on '#syntax' directive in Dockerfile #170

vsiravar opened this issue Jan 18, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@vsiravar
Copy link
Contributor

Describe the bug
Briefly describe the problem you are having.
finch build fails when there is a syntax directive in the Dockerfile.

Steps to reproduce
A clear, step-by-step set of instructions to reproduce the bug.

cat Dockerfile
# syntax=docker/dockerfile:1
FROM public.ecr.aws/docker/library/golang:1.18 AS builder
WORKDIR /build
COPY . .

ARG TARGET_OS
ARG TARGET_ARCH
RUN go env -w GO111MODULE=off
RUN CGO_ENABLED=0 GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o hello .

FROM scratch
EXPOSE 8080
COPY --from=builder /build/hello /app/
WORKDIR /app
ENTRYPOINT ["./hello"]
finch build -f Dockerfile -t test:syntax . 
[+] Building 2.9s (4/4) FINISHED                                                      
 => [internal] load .dockerignore                                                0.0s
 => => transferring context: 2B                                                  0.0s
 => [internal] load build definition from Dockerfile                             0.0s
 => => transferring dockerfile: 445B                                             0.0s
 => resolve image config for docker.io/docker/dockerfile:1                       1.6s
 => docker-image://docker.io/docker/dockerfile:1@sha256:9ba7531bd80fb0a85863272  1.1s
 => => resolve docker.io/docker/dockerfile:1@sha256:9ba7531bd80fb0a858632727cf7  0.0s
 => => sha256:0f354329a20e6c1067c0e51abd3b1721483fafbbe0c333710 8.39MB / 9.21MB  1.3s
 => => extracting sha256:0f354329a20e6c1067c0e51abd3b1721483fafbbe0c33371005980  0.1s
Dockerfile:1
--------------------
   1 | >>> # syntax=docker/dockerfile:1
   2 |     FROM public.ecr.aws/docker/library/golang:1.18 AS builder
   3 |     WORKDIR /build
--------------------
error: failed to solve: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/buildkit-metadata342428500" to rootfs at "/run/config/buildkit/metadata": mount /tmp/buildkit-metadata342428500:/run/config/buildkit/metadata (via /proc/self/fd/6), flags: 0x1021: operation not permitted: unknown
FATA[0003] exit status 1                                
siravara@bcd074105a94 syntaxtests % cat Docker
cat: Docker: No such file or directory

Error

error: failed to solve: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/buildkit-metadata342428500" to rootfs at "/run/config/buildkit/metadata": mount /tmp/buildkit-metadata342428500:/run/config/buildkit/metadata (via /proc/self/fd/6), flags: 0x1021: operation not permitted: unknown
FATA[0003] exit status 1  

Expected behavior
Should build an image.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

Additional context
This ticket is for tracking bug in Buildkit. moby/buildkit#3138

@vsiravar vsiravar added the bug Something isn't working label Jan 18, 2023
@estesp
Copy link
Contributor

estesp commented Mar 14, 2023

Is this currently solved with 0.4.1 moving to rootfull?

@vsiravar
Copy link
Contributor Author

Is this currently solved with 0.4.1 moving to rootfull?

Yes, no errors on syntax directive anymore :).

@vsiravar
Copy link
Contributor Author

Resolved by rootful containerd switch #196.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants