Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git command not working in init container

initContainers:
  - name: git-clone-openg2p
    image: bitnami/odoo
    command: ["/bin/sh","-c"]
    args: ['apt-get git && git clone https://github.com/repo.git && git clone https://github.com/repo.git /bitnami/odoo']
    volumeMounts:
      - name: odoo-data
        mountPath: /bitnami/odoo

I need to add add-ons by cloning git repository into /bitnami/odoo. This is my init container configuration in yaml file. When I helm install and create pod it says "Invalid operation git" in the logs of pod.

like image 860
Ricardo1998 Avatar asked Mar 18 '26 16:03

Ricardo1998


2 Answers

As far as I know, there is no command apt-get get, you probably want:

apt-get install -y git
like image 179
Jonas Avatar answered Mar 20 '26 09:03

Jonas


apt-get git

The correct syntax is

apt-get install --yes git
like image 43
phd Avatar answered Mar 20 '26 07:03

phd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!