Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker guide for home directory #356

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/docker-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ When generating code against the latest OpenTelemetry semantic conventions, we r
```sh
docker run --rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--env HOME=/tmp/weaver \
--mount 'type=bind,source=$(HOME)/.weaver,target=/tmp/weaver/.weaver' \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/src,target=/home/weaver/target' \
otel/weaver:latest \
Expand All @@ -22,11 +24,12 @@ docker run --rm \
/home/weaver/target
```

This has three key components:
This has four key components:

- Using your local user as the docker container user (`-u $(id -u ${USER}):$(id -g ${USER})`)
- Binding your local codegen templates as readonly (`--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly'`)
- Binding the directory where code will be generated to the `/home/weaver/target` directory in the container: (` --mount 'type=bind,source=$(PWD)/src,target=/home/weaver/target'`)
- Granting weaver usage of your `~/.weaver` directory: (`--env HOME=/tmp/weaver --mount 'type=bind,source=$(HOME)/.weaver,target=/tmp/weaver/.weaver'`)

## Advanced Usage - Interactive Shell

Expand Down Expand Up @@ -67,4 +70,4 @@ docker run --rm \
/home/weaver/target
```

Notice in both cases, the docker image is mounting local directories as readonly.
Notice in both cases, the docker image is mounting local directories as readonly.
Loading