stewbasic
stewbasic

Reputation: 841

Git 2.8 fails to update submodules

I am trying to build gRPC inside a docker image, but updating the submodules is failing when using git version 2.8. Specifically this Dockerfile:

FROM alpine:3.3
RUN apk update && apk add git
RUN git clone -b 'v1.17.1' --depth 1 https://github.com/grpc/grpc
RUN git --version
RUN cd grpc && git submodule update --init --depth 1

shows git version 2.8.6 and throws the following error

Cloning into '/grpc/third_party/abseil-cpp'...
error: no such remote ref cc4bed2d74f7c8717e31f9579214ab52a9c9c610

If I switch to alpine:3.8 I get git version 2.18.1 and the build is successful. Is this a bug in the earlier version of git? Is there a workaround?

Notes:

Upvotes: 1

Views: 331

Answers (1)

VonC
VonC

Reputation: 1324977

As you can see in "How to make shallow git submodules?", multiple evolution have been made since Git 2.8.

If available, try and use only one step:

git clone -b 'v1.17.1' --recurse-submodule --depth 1 https://github.com/grpc/grpc 

Upvotes: 1

Related Questions