how to run git inside a container

  debian, docker, docker-compose

I have the following compose file and I need to run multiple commands on the container. I need the container to do a git pull to grab the containers config. This is a Debian build so I have tried to install git and then run the git command. When I do this, the container constantly restarts.

---
version: "3"
services:
  kamailio:
    image:  kamailio/kamailio:5.2.8-stretch
    restart: unless-stopped
    container_name: kamailio
    #environment:
    command:
       - bash
       - -c
       - >
       apt-get install git -y;
       cd /tmp;
       git clone https://github.com/dOpensource/dsiprouter.git;
    volumes:
      - kamailio_Data:/etc/kamailio

Source: Docker Questions

LEAVE A COMMENT