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

docs: add documetation for --group and SecurityDescriptor config #4882

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
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: 6 additions & 1 deletion cmd/buildkitd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func main() {
return strconv.Itoa(*gid)
}

groupUsageStr := "group (name or gid) which will own all Unix socket listening addresses"
if runtime.GOOS == "windows" {
groupUsageStr = "group name(s), comma-separated, which will have RW access to the named pipe listening addresses"
}

app.Flags = append(app.Flags,
cli.StringFlag{
Name: "config",
Expand Down Expand Up @@ -182,7 +187,7 @@ func main() {
},
cli.StringFlag{
Name: "group",
Usage: "group (name or gid) which will own all Unix socket listening addresses",
Usage: groupUsageStr,
Value: groupValue(defaultConf.GRPC.GID),
},
cli.StringFlag{
Expand Down
40 changes: 39 additions & 1 deletion docs/windows.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- details here: https://github.com/thlorenz/doctoc -->
**Table of Contents**

- [Experimental Windows containers support](#experimental-windows-containers-support)
- [Quick start guide](#quick-start-guide)
- [Platform requirements](#platform-requirements)
- [Setup Instructions](#setup-instructions)
- [Example Build](#example-build)
- [Running `buildctl` from a Non-Admin Terminal](#running-buildctl-from-a-non-admin-terminal)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -145,3 +145,41 @@ Now that everything is setup, let's build a [simple _hello world_ image](https:/
```

> **NOTE:** After pushing to the registry, you can use your image with any other clients to spin off containers, e.g. `docker run`, `ctr run`, `nerdctl run`, etc.

## Running `buildctl` from a Non-Admin Terminal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


The default case for running `buildctl` is from an admin (elevated) terminal.
If you attempt running in a non-admin terminal, you will get an `Access Denied`
error, on the named pipe:

```
connection error: desc = "transport: Error while dialing: open \\\\.\\pipe\\buildkitd: Access is denied."
```

However, it is possible to run it in a non-admin terminal by providing
the group name(s) of the users executing the command.

You can find the group names that the current user belongs too by running:

```cmd
whoami /groups
```

You can also create a group and add the user on it by running the following in
an admin terminal:

```powershell
# you can use $env:USERNAME for PowerShell or
# %USERNAME% for CMD terminal
net localgroup buildkit-users <username> /add
profnandaa marked this conversation as resolved.
Show resolved Hide resolved
```
NOTE: You will need to log out and log in for the changes to reflect.

Once you have the group(s), you can supply it as part of the `--group` flag when starting
`buildkitd` (still in an admin termainal). If it is more than one group, comma-separate them. Example:

```powershell
buildkitd --group="USERBOX-1\buildkit-users"
```

With this now, you can run `buildctl` in a non-admin terminal.