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

buildctl fails on Windows with "archive/tar: invalid tar header" #5528

Open
TinaMor opened this issue Nov 18, 2024 · 3 comments
Open

buildctl fails on Windows with "archive/tar: invalid tar header" #5528

TinaMor opened this issue Nov 18, 2024 · 3 comments

Comments

@TinaMor
Copy link

TinaMor commented Nov 18, 2024

Description

buildctl fails on Windows with "archive/tar: invalid tar header" for both type=oci and type=docker using CMD or PowerShell.

> buildctl.exe build --progress=tty --frontend=dockerfile.v0 --local=context=. --output=type=docker,name=test/hello-buildkit,push=false --local=dockerfile=./ --opt=filename=Dockerfile | docker load

archive/tar: invalid tar header
error: failed to solve: failed to copy to tar: rpc error: code = Unknown desc = write /dev/stdout: The pipe is being closed.

Image

Test Dockerfile

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022   
RUN echo "hello"

Additional info

Using --progress plain works

> buildctl.exe build --progress=plain --frontend=dockerfile.v0 --local=context=. --output=type=docker,name=test/hello-buildkit,push=false --local=dockerfile=./ --opt=filename=Dockerfile | docker load

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 108B done
#1 DONE 0.0s

#2 [internal] load metadata for mcr.microsoft.com/windows/nanoserver:ltsc2022
#2 DONE 0.3s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [1/2] FROM mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:be37c9e8bf388c4e3ef27b4a2592b94adab551e231644ce3c9d4d3dc0a50af41
#4 resolve mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:be37c9e8bf388c4e3ef27b4a2592b94adab551e231644ce3c9d4d3dc0a50af41 0.0s done
#4 DONE 0.0s

#5 [2/2] RUN echo "hello"
#5 CACHED

#6 exporting to docker image format
#6 exporting layers done
#6 exporting manifest sha256:5beace3848b86d36f96ada17197ca4558cb4ae79608610094cc878529bb578d7 0.0s done
#6 exporting config sha256:72a13ebdd2882395f1acaa8af867ed4d48993d7cd153a566aa135f12c96efeb4 0.0s done
#6 sending tarball
#6 sending tarball 4.2s done
#6 DONE 4.2s
afe057336777: Loading layer [==================================================>]  116.9MB/116.9MB
35185b6eab61: Loading layer [==================================================>]  73.08kB/73.08kB
Loaded image: test/hello-buildkit:latest

Environment

  1. Windows
    ProductName : Windows Server 2022 Datacenter Evaluation
    ReleaseId : 2009
    CurrentBuild : 20348
    DisplayVersion : 21H2
  2. buildctl
    buildctl github.com/moby/buildkit v0.17.1 8b1b83e
  3. Containerd
    containerd github.com/containerd/containerd/v2 v2.0.0 207ad711eabd375a01713109a8a197d197ff6542
  4. docker
    Version 27.3.1
    Image
@TinaMor
Copy link
Author

TinaMor commented Nov 18, 2024

@profnandaa
Copy link
Collaborator

What do you get on the CMD shell?

@TinaMor
Copy link
Author

TinaMor commented Nov 18, 2024

Same error:

> C:\Windows\System32>buildctl.exe build --progress=tty --frontend=dockerfile.v0 --local=context=. --output=type=oci,name=test/hello-buildkit,push=false --local=dockerfile=./ --opt=filename=Dockerfile | docker load

archive/tar: invalid tar header
error: failed to solve: failed to copy to tar: rpc error: code = Unknown desc = write /dev/stdout: The pipe is being closed.

Image

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

2 participants