Host Volumes

Updated 2 years ago by Admin

Host mounts allow you to mount an absolute path on the host machine into a pipeline step. This setting is only available to trusted repositories.

This setting is only available to trusted repositories, since mounting host machine volumes is a security risk.

1   kind: pipeline
2 type: docker
3 name: default
4
5 steps:
6 - name: build
7 image: node
8 volumes:
9 - name: cache
10 path: /tmp/cache
11 commands:
12 - npm install
13 - npm test
14
15 volumes:
16 - name: cache
17 host:
18 path: /var/lib/cache

The first step is to define the host machine volume path. The host volume path must be an absolute path.

15  volumes:
16 - name: cache
17 host:
18 path: /var/lib/cache

The next step is to configure your pipeline step to mount the named host path into your container. The container path must also be an absolute path.

5   steps:
6 - name: build
7 image: node
8 volumes:
9 - name: cache
10 path: /tmp/cache


How did we do?