Skip to content

Default compression (none) in 0.47.0 breaks docker engine build API version 2 (buildkit) #1886

@pn-santos

Description

@pn-santos

Since version 0.47.0, in a project where the following buildOptions are specified:

<buildOptions>
  <version>2</version>
</buildOptions>

(see https://docs.docker.com/reference/api/engine/version/v1.51/#tag/Image/operation/ImageBuild)

will cause the image build to fail with:

[ERROR] DOCKER> Unable to build image [my-image] : "dockerfile parse error on line 1: unknown instruction: ./PaxHeaders.X/(...)

The same exact setup works in both 0.46.0 and 0.45.0 (didn't check earlier).

AFAICT the issue sees to be the tar archive format, in 0.46.0 the hex dump shows something like this:

00000000  63 74 78 2f 00 00 00 00  00 00 00 00 00 00 00 00  |ctx/............|
00000000  63 74 78 2f 00 00 00 00  00 00 00 00 00 00 00 00  |ctx/............|

(ctx is the name of the assembly and the dir under which all files referenced by the Dockerfile are located)

while in 0.47.0 it shows this:

00000000  2e 2f 50 61 78 48 65 61  64 65 72 73 2e 58 2f 63  |./PaxHeaders.X/c|
00000000  2e 2f 50 61 78 48 65 61  64 65 72 73 2e 58 2f 63  |./PaxHeaders.X/c|
00000010  74 78 5f 00 00 00 00 00  00 00 00 00 00 00 00 00  |tx_.............|
00000010  74 78 5f 00 00 00 00 00  00 00 00 00 00 00 00 00  |tx_.............|

Not sure where ./PaxHeaders.X/ comes from (related to tar format?) but the docker API doesn't seem to like/support it (I can open/extract the tar file manually just fine though, so maybe this is a limitation of the docker API?).

I experimented with it a bit and found the following workarounds (either works):

  • Setting compression to anything other than none
  • Setting the assembly mode to anything other than the default (dir)

So it definitely seems related to changes that affect the tar file creation between 0.46.0 and 0.47.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions