Skip to content

--opt 'context=https://github.com/ORG/REPO.git?tag=TAG fails (only with some repo?) #6178

@AkihiroSuda

Description

@AkihiroSuda

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Bug description

buildctl build --frontend dockerfile.v0 -opt 'context=https://github.com/docker/buildx.git?tag=v0.28.0-rc1' fails:

fatal: https://github.com/docker/buildx?tag=v0.28.0-rc1/info/refs not valid: is this a git repository?
: exit status 128

OTOH, --opt context=https://github.com/docker/buildx.git#v0.28.0-rc1 works.

Reproduction

$ sudo buildctl build --frontend dockerfile.v0 --opt 'context=https://github.com/docker/buildx.git?tag=v0.28.0-rc1'
[+] Building 5.5s (4/4) FINISHED                                                                                                          
 => [internal] load git source https://github.com/docker/buildx.git?tag=v0.28.0-rc1                                                  3.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                            1.4s 
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:38387523653efa0039f8e1c89bb74a30504e76ee9f565e25c9a09841f9427b05      0.0s 
 => => resolve docker.io/docker/dockerfile:1@sha256:38387523653efa0039f8e1c89bb74a30504e76ee9f565e25c9a09841f9427b05                 0.0s 
 => ERROR [internal] load git source https://github.com/docker/buildx.git?tag=v0.28.0-rc1                                            1.0s 
------                                                                                                                                    
 > [internal] load git source https://github.com/docker/buildx.git?tag=v0.28.0-rc1:                                                       
0.005 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/144/fs/                                    
1.024 warning: redirecting to https://github.com/docker/buildx?tag=v0.28.0-rc1/
1.024 fatal: https://github.com/docker/buildx?tag=v0.28.0-rc1/info/refs not valid: is this a git repository?
------
Dockerfile:1
--------------------
   1 | >>> # syntax=docker/dockerfile:1
   2 |     
   3 |     ARG GO_VERSION=1.24
--------------------
error: failed to solve: failed to load cache key: error fetching default branch for repository https://github.com/docker/buildx.git?tag=v0.28.0-rc1: git stderr:
warning: redirecting to https://github.com/docker/buildx?tag=v0.28.0-rc1/
fatal: https://github.com/docker/buildx?tag=v0.28.0-rc1/info/refs not valid: is this a git repository?
: exit status 128

Version information

v0.24.0-rc2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions