mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-27 19:00:35 +00:00
Local image documentation (#2521)
Add some documentation on how to build then use a local `Docker` image. It's hinted in the [Volumes](https://woodpecker-ci.org/docs/usage/volumes) doc, but I think it's worth to make it more visible. Relates to https://github.com/woodpecker-ci/woodpecker/issues/1175.
This commit is contained in:
parent
cbd0c26a0c
commit
2f4690a6b6
1 changed files with 25 additions and 0 deletions
|
@ -163,6 +163,31 @@ To make a private registry globally available check the [server configuration do
|
|||
|
||||
For specific details on configuring access to Google Container Registry, please view the docs [here](https://cloud.google.com/container-registry/docs/advanced-authentication#using_a_json_key_file).
|
||||
|
||||
##### Local Images
|
||||
|
||||
It's possible to build a local image by mounting the docker socket as a volume.
|
||||
|
||||
With a `Dockerfile` at the root of the project:
|
||||
|
||||
```diff
|
||||
steps:
|
||||
build-image:
|
||||
image: docker
|
||||
commands:
|
||||
- docker build --rm -t local/project-image .
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
build-project:
|
||||
image: local/project-image
|
||||
commands:
|
||||
- ./build.sh
|
||||
```
|
||||
|
||||
:::warning
|
||||
For this privileged rights are needed only available to admins. In addition this only works when using a single agent.
|
||||
:::
|
||||
|
||||
### `commands`
|
||||
|
||||
Commands of every pipeline step are executed serially as if you would enter them into your local shell.
|
||||
|
|
Loading…
Reference in a new issue