Host Volumes
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.
privileged: true
for the step in order for Docker-in-Docker to work as expected.1 kind: pipeline
2 type: kubernetes
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