mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-15 14:34:26 +00:00
13c6150b9a
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: qwerty287 <qwerty287@posteo.de> Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
27 lines
994 B
Markdown
27 lines
994 B
Markdown
# 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.
|
|
|
|
:::note
|
|
Volumes are only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./75-project-settings.md#trusted) to enable trusted mode.
|
|
:::
|
|
|
|
```diff
|
|
steps:
|
|
- name: 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
|
|
```
|
|
|
|
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 ]
|
|
```
|