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

Commit

Permalink
Merge pull request #4246 from Codelax/cli-runner-install-socket-path
Browse files Browse the repository at this point in the history
feat(cli): add socket-path flag to runner install
  • Loading branch information
paladin-devops committed Jan 4, 2023
2 parents 6dfb969 + f430e44 commit 5950711
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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

0 comments on commit 5950711

Please sign in to comment.