Using gitRepo To Mount a Git Repository
In this lesson, we will explore the gitRepo Volume type.
The gitRepo Volume Type
The gitRepo
Volume type is probably not going to be on your list of top three Volume types. Or, maybe it will. It all depends on your use cases. We like it since it demonstrates how a concept of a Volume can be extended to a new and innovative solution.
Looking into the Definition
Let’s see it in action through the volume/github.yml
definition.
Press + to interact
cat volume/github.yml
The output is as follows.
Press + to interact
apiVersion: v1kind: Podmetadata:name: githubspec:containers:- name: githubimage: docker:17.11command: ["sleep"]args: ["100000"]volumeMounts:- mountPath: /var/run/docker.sockname: docker-socket- mountPath: /srcname: githubvolumes:- name: docker-sockethostPath:path: /var/run/docker.socktype: Socket- name: githubgitRepo:repository: https://github.com/vfarcic/go-demo-2.gitdirectory: .
This Pod definition is very similar to volume/docker.yml
. The only significant difference is that we added the second ...
Access this course and 1400+ top-rated courses and projects.