How to add the possibility to use the "git clone" command in a container


I need to use the command “git clone” in a container but I can’t do it because the container says:

bash: git: command not found

I need to use the command for add a module in the icinga container…

I looked in the Dockerfile and I saw this:

#First apt-get batch
RUN export DEBIAN_FRONTEND=noninteractive \
     && apt-get update \
     && apt-get upgrade -y \
     && apt-get install -y --no-install-recommends \
          ca-certificates \
          curl \
          gcc  \
          gnupg2 \
          graphviz \
          logrotate \
          mysql-client \
          net-tools \
          ntp       \
          php5-cli \
          php5-gd \
          php5-intl \
          php5-imagick \
          php5-curl \
          php5-ldap \
          php5-mysql \
          php5-sqlite \
          procps \
          python \
          python-dev \
          pwgen \
          rsync \
          snmp \
          libsnmp-base \
          tcpdump \
          sudo \
          supervisor \
          unzip \
          wget \
     && apt-get clean \
     && rm -rf /var/lib/apt/lists/*

So I think that these are the only command available…how can I enable the “git” command? is enough to add “git” to the list I have reposted above?

Thank You



You can add it to the list above though you will need to rebuild the container.
But as far as I know, you can install modules without git, just by downloading tar.gz files.

What module are you trying to install by the way?



Director and the modules required for it…
If I rebuild the container it will integrate good with the other icinga container and the mariadb container?

How can I make a backup?


All the modules support git and tarballs. In fact cloning the repo is not recommended since there probably are commits after the release which could introduce bugs or instabilities.

As for the containers, no one can guarantee you compatibility. Probably yes, but shit happens.


1 Like