Skip to content

Commit

Permalink
Improve documentation and error message for custom docker images (#7968)
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie-lou authored Nov 27, 2024
1 parent b5374bb commit 9801517
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/remote-bazel-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ https://app.buildbuddy.io/api/v1/Run
If your GitHub repo is private, you must first link it at https://app.buildbuddy.io/workflows/
to authorize the remote runner to access it.

### Custom Docker images

If you'd like to specify a custom Docker image for the remote runner, you can use
the `--container_image` flag. Be aware of the following requirements when using
a custom image:

- By default, the remote runner assumes a non-root user named `buildbuddy` is
provisioned on the runner.
- Either make sure your image has a provisioned user named `buildbuddy`, or
specify a custom user with `--runner_exec_properties=dockerUser=myUser`.
- Images are expected to be prefixed with `docker://`.
- Ex. `docker://gcr.io/flame-public/rbe-ubuntu20-04-workflows:latest`

### Private Docker images

If you would like the remote runner to start from a private container image, you
Expand Down
2 changes: 1 addition & 1 deletion enterprise/server/remote_execution/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func ApplyOverrides(env environment.Env, executorProps *ExecutorProperties, plat
} else if !strings.HasPrefix(platformProps.ContainerImage, DockerPrefix) {
// Return an error if a client specified an unparseable
// container reference.
return status.InvalidArgumentError("Malformed container image string.")
return status.InvalidArgumentErrorf("malformed container image string - should be prefixed with '%s'", DockerPrefix)
}
// Trim the docker prefix from ContainerImage -- we no longer need it.
platformProps.ContainerImage = containerImageName(platformProps.ContainerImage)
Expand Down

0 comments on commit 9801517

Please sign in to comment.