Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 1.28 KB

README.md

File metadata and controls

45 lines (37 loc) · 1.28 KB

git-clone-container

Travis (.org)

Minimal Git CLI container build from scratch. I use this as init container on Kubernetes.

The container is optimized with UPX and only contains the binaries needed for a git clone from HTTP or HTTPS, NO SSH SUPPORT. This is a personal choice, if needed I can add it :)

Usage

docker run -v $PWD:/config lansible/git-clone \
clone --depth 1 https://github.com/LANsible/git-container.git /config

Examples

Kubernetes init container for Home-Assistant

In the following examples an init container pulls a git repository into a shared emptyDir volume.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: example
spec:
  initContainers:
    - image: lansible/git-clone:latest
      name: init-config
      command: ['--depth 1 https://github.com/wilmardo/home-assistant.git /config']
      volumeMounts:
        - mountPath: /config
          name: config
  containers:
    - image: main/main-container
      name: main-container
      volumeMounts:
        - mountPath: /config
          name: config
  volumes:
    - name: config
      emptyDir: {}