woodpecker/docs/docs/20-usage/70-volumes.md

28 lines
987 B
Markdown
Raw Normal View History

2019-11-15 11:03:15 +00:00
# Volumes
Woodpecker gives the ability to define Docker volumes in the YAML. You can use this parameter to mount files or folders on the host machine into your containers.
2019-11-15 11:03:15 +00:00
:::note
2022-08-31 23:52:52 +00:00
Volumes are only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode.
:::
2019-11-15 11:03:15 +00:00
```diff
steps:
build:
image: docker
commands:
- docker build --rm -t octocat/hello-world .
- docker run --rm octocat/hello-world --test
- docker push octocat/hello-world
- docker rmi octocat/hello-world
volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
2019-11-15 11:03:15 +00:00
```
Please note that Woodpecker mounts volumes on the host machine. This means you must use absolute paths when you configure volumes. Attempting to use relative paths will result in an error.
```diff
-volumes: [ ./certs:/etc/ssl/certs ]
+volumes: [ /etc/ssl/certs:/etc/ssl/certs ]
2019-11-15 11:03:15 +00:00
```