首页 > 解决方案 > Git命令在init容器中不起作用

问题描述

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

我需要通过将 git 存储库克隆到/bitnami/odoo. 这是我在 yaml 文件中的初始化容器配置。当我helm install创建 pod 时,它在 pod 的日志中显示“无效操作 git”。

标签: gitdockerkubernetes

解决方案


据我所知,没有 command apt-get get,您可能想要:

apt-get install -y git

推荐阅读