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

Can't build image via git URL when git repo has submodules #40616

Open
kriddile opened this issue Mar 3, 2020 · 0 comments
Open

Can't build image via git URL when git repo has submodules #40616

kriddile opened this issue Mar 3, 2020 · 0 comments
Labels
area/builder kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. version/19.03

Comments

@kriddile
Copy link

kriddile commented Mar 3, 2020

Description

When invoking docker build with a git URL, if the git reference being checked out contains a reference to a submodule that is not at the head of a branch or recent tag in the submodule's repo, the operation fails.

Steps to reproduce the issue:

  1. docker build <git URL with a submodule reference not at a branch head or recent tag in the submodule repo>

Describe the results you received:

unable to prepare context: unable to 'git clone' to temporary context directory: error initializing submodules: Submodule 'Foo' (git@github.com:foo/bar.git) registered for path 'Foo'
Cloning into '/private/var/folders/86/ddj24jnj17jf1vjx2s_fmw8w0000gn/T/docker-build-git585701942/Foo'...
error: Server does not allow request for unadvertised object 34ad12fa10bfefc73e027940753d9d70845e4a89
Fetched in submodule path 'Foo', but it did not contain 34ad12fa10bfefc73e027940753d9d70845e4a89. Direct fetching of that commit failed.
: exit status 1

Describe the results you expected:
Successfully built

Additional information you deem important:
I believe this problem is caused by docker build cloning the requested git repository with the --depth=0 flag. The documentation makes no mention of --depth=0 being used.

Output of docker version:

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:34 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:29:19 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 16
  Running: 0
  Paused: 0
  Stopped: 16
 Images: 11
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 1.943GiB
 Name: docker-desktop
 ID: EYRW:KLGG:S7GY:M7YZ:FHTL:KX2P:Z4NJ:MJZG:BFQV:KAWB:FBC4:3O7O
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 36
  Goroutines: 52
  System Time: 2020-03-03T21:14:12.232032346Z
  EventsListeners: 3
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine
@AkihiroSuda AkihiroSuda added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/builder labels Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. version/19.03
Projects
None yet
Development

No branches or pull requests

3 participants