You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: "Transport became inactive" on 'container build' (0.5.0) – 16k limit on Container-files? #735
I haven't confirmed it yet, but I believe this issue is due to GRPC header limit (16K default) and us sending the Dockerfile via GRPC header to the builder
Ah! :)
My 16+KB Dockerfile caused the obscure message Error: unavailable (14): Transport became inactive.
Easy fix as I was able to remove loads of line comments in order to decrease the file size.
May I suggest making the error message clearer?
My Dockerfile failed at 425 lines (~15.4KB on disk, much of it inline comments and heredoc-formatted RUN blocks). After stripping inline comments to bring the file to ~400 lines, the build succeeds reliably.
One year on, this remains a pretty major shortcoming of Apple Container tooling :(
When reducing/eliminating comments and externalizing "heredocs" doesn't sufficiently decrease the Containerfile/Dockerfile size, stacking images is an option but at that point one might have given up :)
My current workaround for large Container|Dockerfiles is to use the docker CLi to build, and Apple Container to run. Not ideal but at least OCi interoperability helps here.
Sharing my findings in case they help whoever picks this up.
I reproduced it on main. The cause is the HTTP/2 frame size, not a header limit. swift-nio-http2 sends all request headers in one HEADERS frame (no CONTINUATION), and grpc-go caps frames at 16384, so the base64 Dockerfile plus the other metadata overflows after HPACK. That's why builds fail anywhere from about 13.8 to 16.1 KB, below the #1634 guard.
A possible minimal fix, along the lines of wlan0's earlier suggestion: the shim accepts the Dockerfile, .dockerignore, and secrets as the first stream message and advertises that in Info. The CLI uses it when the shim supports it and keeps the current header path otherwise.
Measurements and details are below.
Measurements and details
Raw Dockerfile size at the pass/fail boundary, by padding type:
Padding
Last pass
First fail
long comment line
14,326
14,327
random alphanumerics
14,823
14,824
bytes that base64 to TTTT
13,815
13,816
bytes that base64 to 7777
16,114
16,115
long comment + 3,000 B .dockerignore
11,472
11,473
In every row, the Huffman-encoded size of the dockerfile value is about 16,118 bytes at the boundary. In the last row, that figure is the Dockerfile and .dockerignore values combined. The remaining fixed headers add about 265 bytes, which reaches 16,384.
The exact boundary moves by a few bytes between runs, because the random build-id UUID's encoded size varies.
Code paths:
HTTP2FrameEncoder.swift: always sets END_HEADERS, and throws frameSizeError when the payload exceeds the peer's max frame size. Upstream main is the same.
grpc-go: http2MaxFrameLen = 16384 is a constant.
grpc-swift: maxFrameSize only affects what the client receives.
A failing run leaves no serving grpc connection / session started lines in the shim log; only the Info call shows up.
Implementation notes:
The shim reads the first packet with Recv() before NewPipeline/Run, and dockerfile becomes optional in NewBuildOpts.
The CLI writes BuildConfig in the request producer before relaying the stream, because the terminal-resize task yields packets concurrently.
Add an integration test with a 64 KiB+ Dockerfile and a large secret.
Activity
wlan0 commentedon Oct 8, 2025
Hi @srcshelton, thanks for the bug report.
I haven't confirmed it yet, but I believe this issue is due to GRPC header limit (16K default) and us sending the Dockerfile via GRPC header to the builder
container/Sources/ContainerBuild/Builder.swift
Line 313 in 7370923
I'll confirm the issue and change the builder protocol to expect Dockerfile in a GRPC message instead of header
blacktop commentedon Feb 4, 2026
bump
danielweck commentedon Mar 9, 2026
Ah! :)
My 16+KB
Dockerfilecaused the obscure messageError: unavailable (14): Transport became inactive.Easy fix as I was able to remove loads of line comments in order to decrease the file size.
May I suggest making the error message clearer?
digitalpardoe commentedon Mar 16, 2026
I've just experienced this issue with a 28KB
Dockerfilethat can't really be trimmed down.deviantony commentedon May 10, 2026
I think I hit a similar issue with container 0.12.3 on macOS 26, except that I got a different error message:
My Dockerfile failed at 425 lines (~15.4KB on disk, much of it inline comments and heredoc-formatted RUN blocks). After stripping inline comments to bring the file to ~400 lines, the build succeeds reliably.
Wire xcodebuildmcp into alapenna-container via Unix-socket bridge
27 remaining items
fix: the Dockerfile fits in Apple's 16 KiB, so the reasons live in th…
test(dockerfile): retire the size gate that measured the wrong number
Add an error message for dockerfile >= 16KB until apple#735 is resolv…
fix(chelly): apple/container の 16 KiB 制限に収まるよう Dockerfile のコメントを落として渡す
fix(sandbox): ocaml 레시피가 Apple container 빌더의 Dockerfile 한도 안에 들어오게 해요 (…
fix: resolve Dockerfile paths against devcontainer.json on both backe…
docs: ソースのコメントを日本語にし、Dockerfile の大きさを見張る(CAPTURE-42) (#122)
danielweck commentedon Nov 9, 2026
One year on, this remains a pretty major shortcoming of Apple Container tooling :(
When reducing/eliminating comments and externalizing "heredocs" doesn't sufficiently decrease the Containerfile/Dockerfile size, stacking images is an option but at that point one might have given up :)
philwhln commentedon Nov 13, 2026
The lag here might be that the Issue is assigned @wlan0 , who no longer works at Apple.
@wlan0, do you know how to get some eyeballs on this or get it reassigned?
danielweck commentedon Nov 13, 2026
My current workaround for large Container|Dockerfiles is to use the docker CLi to build, and Apple Container to run. Not ideal but at least OCi interoperability helps here.
Move inline configs out of alapenna-container Dockerfile
jaeyeonme commentedon Nov 14, 2026
Sharing my findings in case they help whoever picks this up.
I reproduced it on main. The cause is the HTTP/2 frame size, not a header limit. swift-nio-http2 sends all request headers in one HEADERS frame (no CONTINUATION), and grpc-go caps frames at 16384, so the base64 Dockerfile plus the other metadata overflows after HPACK. That's why builds fail anywhere from about 13.8 to 16.1 KB, below the #1634 guard.
A possible minimal fix, along the lines of wlan0's earlier suggestion: the shim accepts the Dockerfile,
.dockerignore, and secrets as the first stream message and advertises that inInfo. The CLI uses it when the shim supports it and keeps the current header path otherwise.Measurements and details are below.
Measurements and details
Raw Dockerfile size at the pass/fail boundary, by padding type:
TTTT7777.dockerignoredockerfilevalue is about 16,118 bytes at the boundary. In the last row, that figure is the Dockerfile and.dockerignorevalues combined. The remaining fixed headers add about 265 bytes, which reaches 16,384.build-idUUID's encoded size varies.HTTP2FrameEncoder.swift: always setsEND_HEADERS, and throwsframeSizeErrorwhen the payload exceeds the peer's max frame size. Upstream main is the same.http2MaxFrameLen = 16384is a constant.maxFrameSizeonly affects what the client receives.serving grpc connection/session startedlines in the shim log; only theInfocall shows up.Recv()beforeNewPipeline/Run, anddockerfilebecomes optional inNewBuildOpts.BuildConfigin the request producer before relaying the stream, because the terminal-resize task yields packets concurrently.feat(compose): split over-cap builds for apple, keep other backends r…
fix(macos): build from a comment-free Containerfile copy under Apple …