Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

feat(cli): add socket-path flag to runner install #4246

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/4246.txt
@@ -0,0 +1,3 @@
```release-note:feature
cli: add socket-path flag to runner install
```
10 changes: 9 additions & 1 deletion internal/runnerinstall/docker.go
Expand Up @@ -22,6 +22,7 @@ import (
type DockerConfig struct {
RunnerImage string `hcl:"runner_image,optional"`
Network string `hcl:"network,optional"`
SocketPath string `hcl:"socket_path,optional"`
}

type DockerRunnerInstaller struct {
Expand Down Expand Up @@ -116,7 +117,7 @@ func (i *DockerRunnerInstaller) Install(ctx context.Context, opts *InstallOpts)
}, &container.HostConfig{
Privileged: true,
CapAdd: []string{"CAP_DAC_OVERRIDE"},
Binds: []string{"/var/run/docker.sock:/var/run/docker.sock"},
Binds: []string{i.Config.SocketPath + ":/var/run/docker.sock"},
// These security options are required for the runner so that
// Docker daemonless image building works properly.
SecurityOpt: []string{
Expand Down Expand Up @@ -152,6 +153,13 @@ func (i *DockerRunnerInstaller) InstallFlags(set *flag.Set) {
Target: &i.Config.Network,
Usage: "The Docker network in which to deploy the Waypoint runner.",
})

set.StringVar(&flag.StringVar{
Name: "docker-socket-path",
Target: &i.Config.SocketPath,
Usage: "The path of the docker socket that will be bound in runner",
Default: "/var/run/docker.sock",
})
}

func (d DockerRunnerInstaller) Uninstall(ctx context.Context, opts *InstallOpts) error {
Expand Down
1 change: 1 addition & 0 deletions website/content/commands/runner-install.mdx
Expand Up @@ -55,6 +55,7 @@ the install, the command would be:

- `-docker-runner-image=<string>` - The Docker image for the Waypoint runner. The default is hashicorp/waypoint.
- `-docker-runner-network=<string>` - The Docker network in which to deploy the Waypoint runner.
- `-docker-socket-path=<string>` - The path of the docker socket that will be bound in runner. The default is /var/run/docker.sock.

#### ecs Options

Expand Down