#failed to resolve dockerfile: unknown API capability exec.validexitcode in 0.14.0 engine

1 messages ยท Page 1 of 1 (latest)

fast axle
#

Hello Team ๐Ÿ‘‹

Recently we upgraded to 0.14.0, we are getting failure for one of docker build
failed to resolve dockerfile: unknown API capability exec.validexitcode

the same docker file worked with 0.13.0 engine

could anyone please help guide me what could be wrong?

timid badger
#

๐Ÿค” uh

#

does your dockerfile have a #syntax directive?

fast axle
#

yeah, it has


## Build
FROM jfrog.com/projects/golang/golang-ci:1.21 AS build
WORKDIR /app
COPY go.mod .
COPY *.go ./
RUN go build -ldflags='-extldflags=-static -s' -tags osusergo,netgo,static_build

## Deploy
FROM scratch
WORKDIR /app
COPY --from=build /app/app1 /app
EXPOSE 80
ENTRYPOINT ["/app/app1
"]```
#

@timid badger new engine is in production and its imptacting some customers, any way we can fix this quickly?

timid badger
#

i'm looking into this now, but we won't be able to ship a fix till later in the week

fast axle
#

for now i have asked customers to remove that line, do you want me to create a bug isuue or you have it already?

timid badger
#

feel free to create an issue ๐Ÿ™‚

fast axle
fast axle
#

Hey @timid badger is this fix still planned for end of the week?

timid badger
#

sorry, i haven't had time to properly dive into it

fast axle
#

๐Ÿ‘‹ @timid badger could you please give me some idea on when this fix will be shipped? ๐Ÿ™‚

timid badger
#

i can't reproduce the issue - replied in the issue

fast axle
#

@timid badger I cannot reproduce the issue via module api but using old sdk way I do
here's the detailed log from engine

time="2024-12-16T16:43:28Z" level=debug msg="starting container" args="[/.init /bin/dockerfile-frontend]" client_hostname=W376RQYWKP client_id=pvofi5fygtmnl70cs1ytn5thu id=vxl1am3lnp1915t3sev0hv2bd session_id=o3hy9k62jo34w1cmd56fofqt2 spanID=e1016607e39c94a5 traceID=70957693369247108f60e2781757ab31
time="2024-12-16T16:43:29Z" level=error msg="fatal error: unknown API capability exec.validexitcode\ngithub.com/moby/buildkit/util/apicaps.(*CapSet).Supports\n\t/src/util/apicaps/caps.go:111\ngithub.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Solve\n\t/src/frontend/gateway/grpcclient/client.go:349\ngithub.com/moby/buildkit/frontend/dockerui.(*Client).ReadEntrypoint\n\t/src/frontend/dockerui/config.go:342\ngithub.com/moby/buildkit/frontend/dockerfile/builder.Build\n\t/src/frontend/dockerfile/builder/build.go:45\ngithub.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Run\n\t/src/frontend/gateway/grpcclient/client.go:218\ngithub.com/moby/buildkit/frontend/gateway/grpcclient.RunFromEnvironment\n\t/src/frontend/gateway/grpcclient/client.go:107\nmain.main\n\t/src/frontend/dockerfile/cmd/dockerfile-frontend/main.go:29\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1197\nfailed to resolve dockerfile\ngithub.com/moby/buildkit/frontend/dockerui.(*Client).ReadEntrypoint\n\t/src/frontend/dockerui/config.go:346\ngithub.com/moby/buildkit/frontend/dockerfile/builder.Build\n\t/src/frontend/dockerfile/builder/build.go:45\ngithub.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Run\n\t/src/frontend/gateway/grpcclient/client.go:218\ngithub.com/moby/buildkit/frontend/gateway/grpcclient.RunFromEnvironment\n\t/src/frontend/gateway/grpcclient/client.go:107\nmain.main\n\t/src/frontend/dockerfile/cmd/dockerfile-frontend/

could you please take a look ๐Ÿ™‚

#
main.go:29\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1197"
panic: failed to resolve dockerfile: unknown API capability exec.validexitcode
timid badger
#

can you please share a full go script that you can run to reproduce it? i'm struggling to reproduce, and i'm busy atm on other regressions - so having a reproducible example is very useful

timid badger
fast axle
#

just replied there
basically, we are getting error with this directive
# syntax=docker/dockerfile:1.7-labs

#

Some more intersting part
if the same content exist locally in Dockerfile at host machine

# syntax=docker/dockerfile:1.7-labs
FROM golang:1.23.1 as builder

and later calling this via sdk

dir := client.Host().Directory("docker-context-dir-path")
ctr := dir.DockerBuild()

it actually works, but failing when native dagger *Directory is used without using Host

timid badger
#

yeah i think i've found the issue

timid badger
#

it'll be included in the next release

#

in the meantime, you can update the syntax directive to just be docker/dockerfile:1.11 or later - the issue is in 1.10 and before

fast axle
#

Does it require engine upgrade or just sdk upgrade? right now at 0.14.0

#

in the meantime, you can update the syntax directive to just be docker/dockerfile:1.11 or later - the issue is in 1.10 and before
does docker/dockerfile:1.11 has everything that this has # syntax=docker/dockerfile:1.7-labs?