# Problem with updating Git Submodules in Docker container

**URL:** <https://forums.docker.com/t/problem-with-updating-git-submodules-in-docker-container/62282>\
**Category:** Docker Toolbox\
**Tags:** build\
**Created:** [November 7, 2018, 10:56am UTC](https://forums.docker.com/t/problem-with-updating-git-submodules-in-docker-container/62282 "2018-11-07T10:56:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonosman](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@dragonosman](https://forums.docker.com/u/dragonosman)\
**Post date:** [November 7, 2018, 10:56am UTC](https://forums.docker.com/t/problem-with-updating-git-submodules-in-docker-container/62282/1 "2018-11-07T10:56:16Z")

</div>

I’m creating a new thread for this since I thought it might need it.

Just a bit ago, when trying to build my Dockerfile project, I ran into this problem:

> Step 16/24 : RUN git clone [GitHub - jinja2cpp/Jinja2Cpp: Jinja2 C++ (and for C++) almost full-conformance template engine implementation](https://github.com/flexferrum/jinja2cpp) && cd jinja2cpp && git pull && git submodule -q update --init && mkdir build && cd build && cmake … -DCMAKE\_INSTALL\_PREFIX=…/install -DCMAKE\_PREFIX\_PATH:PATH=/usr/local/include -DBOOST\_ROOT=/usr/local/include && cmake --build . --target all --config Release && cmake --build . --target install --config Release  
> —\> Running in 3d2a0b4f2e48  
> Cloning into ‘jinja2cpp’…  
> remote: Enumerating objects: 77, done.  
> remote: Counting objects: 100% (77/77), done.  
> remote: Compressing objects: 100% (62/62), done.  
> remote: Total 1364 (delta 31), reused 30 (delta 14), pack-reused 1287  
> Receiving objects: 100% (1364/1364), 400.08 KiB | 150.00 KiB/s, done.  
> Resolving deltas: 100% (937/937), done.  
> Already up to date.  
> /usr/lib/git-core/git-submodule: 7: /usr/lib/git-core/git-submodule: sed: not found  
> /usr/lib/git-core/git-submodule: 86: /usr/lib/git-core/git-sh-setup: sed: not found  
> /usr/lib/git-core/git-submodule: 332: /usr/lib/git-core/git-sh-setup: uname: not found  
> /bin/sh: 1: mkdir: not found  
> The command ‘/bin/sh -c git clone [GitHub - jinja2cpp/Jinja2Cpp: Jinja2 C++ (and for C++) almost full-conformance template engine implementation](https://github.com/flexferrum/jinja2cpp) && cd jinja2cpp && git pull && git submodule -q update --init && mkdir build && cd build && cmake … -DCMAKE\_INSTALL\_PREFIX=…/install -DCMAKE\_PREFIX\_PATH:PATH=/usr/local/include -DBOOST\_ROOT=/usr/local/include && cmake --build . --target all --config Release && cmake --build . --target install --config Release’ returned a non-zero code: 127

Dockerfile:

> FROM dragonosman/ubuntu:latest-sudo  
> RUN adduser --disabled-password --gecos ‘’ osman  
> RUN adduser osman sudo  
> RUN echo ‘%sudo ALL=(ALL) NOPASSWD:ALL’ \>\> /etc/sudoers  
> USER osman  
> WORKDIR /home/osman/  
> COPY scripts ./scripts  
> COPY styles ./styles  
> COPY currency\_converter.cpp /home/osman/  
> COPY index.html /home/osman/  
> RUN ls  
> RUN sudo apt-get update -y   
> && sudo apt-get install -y git   
> g++   
> build-essential   
> make   
> wget  
> RUN sudo mkdir /usr/local/cmake   
> && sudo wget -O cmake-linux.sh [https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86\_64.sh](https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh)   
> && sudo sh cmake-linux.sh – --skip-license --prefix=/usr/local/cmake  
> ENV PATH=“/usr/local/cmake/bin:${PATH}“13  
> RUN sudo wget [https://dl.bintray.com/boostorg/release/1.68.0/source/boost\_1\_68\_0.tar.bz2](https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.bz2)   
> && sudo tar -xjf boost\_1\_68\_0.tar.bz2   
> && sudo rm -rf boost\_1\_68\_0.tar.bz2   
> && cd boost\_1\_68\_0   
> && sudo ./bootstrap.sh --prefix=/usr/local \   
> && sudo ./b2 link=shared install  
> RUN git clone [GitHub - jinja2cpp/Jinja2Cpp: Jinja2 C++ (and for C++) almost full-conformance template engine implementation](https://github.com/flexferrum/jinja2cpp)   
> && cd jinja2cpp   
> && git pull   
> && git submodule -q update --init \   
> && mkdir build \   
> && cd build   
> && cmake … -DCMAKE\_INSTALL\_PREFIX=…/install -DCMAKE\_PREFIX\_PATH:PATH=/usr/local/include -DBOOST\_ROOT=/usr/local/include   
> && cmake --build . --target all --config Release  
> && cmake --build . --target install --config Release  
> RUN git clone [GitHub - nlohmann/json: JSON for Modern C++](https://github.com/nlohmann/json)  
> RUN g++ -std=c++17 -Wall -pedantic -D variant\_CONFIG\_SELECT\_VARIANT=variant\_VARIANT\_NONSTD -I ./jinja2cpp/install/include -I ./json/single\_include -I /usr/local/include/ currency\_converter.cpp -L ./jinja2cpp/install/lib/static -ljinja2cpp -L usr/local/lib/ -lboost\_system -lpthread -o currency\_converter  
> EXPOSE 8080  
> ENV apikey=”:${apikey}”  
> ENV accesskey=“:${accesskey}”  
> RUN echo -e “\n/usr/local/lib” | sudo tee -a /etc/ld.so.conf   
> && sudo ldconfig  
> RUN chmod -r–r–r-- styles.css scripts.js index.html   
> && chmod a+x currency\_converter  
> CMD [“./currency\_converter”, “0.0.0.0”, “8080”, “.”]

Anyone have any idea how to fix this?

I’m using Docker Toolbox version 18.03.0-ce, build 0520e24302. OS is Windows 10 Home Single Language, version 1803 build 17134.345. My code is on GitHub [here](https://github.com/DragonOsman/currency_converter). The one inside the directory with the Dockerfile has a difference compared to the one on GitHub, but it’s mostly the same. The difference is: in the scripts.js file, the POST action value for the form is [https://dragonscurrencyconv.herokuapp.com](https://dragonscurrencyconv.herokuapp.com) (because I want to deploy the Docker image to Heroku at that address – address won’t work at the moment, though, since the app hasn’t been deployed to Heroku yet).

[Why did the “EXPOSE 8080” and “ENV” parts get mixed into the compilation command? I don’t have it like that in the Dockerfile.]

Edit: Okay, I think I figured it out. I was counting the number of steps in the Dockerfile earlier by typing in numbers, but I forgot to take out the “13” at the end of the ENV command for adding CMake to the PATH. I wasn’t able to get it to change the file permissions on those files either, but I should be able to that when building the container as root user and then running it as a normal user (should work for this app).
