Equivalent of "docker run --init" using the Go SDK? #46883
Answered
by
thaJeztah
davechallis
asked this question in
Q&A
-
I'm creating some containers in Go using the SDK (https://pkg.go.dev/github.com/docker/docker/client). I'd like to start a containers with an init process (https://docs.docker.com/engine/reference/run/#specify-an-init-process). On the CLI, I'd do this with |
Beta Was this translation helpful? Give feedback.
Answered by
thaJeztah
Dec 4, 2023
Replies: 1 comment 1 reply
-
The And moby/api/types/container/hostconfig.go Lines 472 to 473 in df59a35 And the API docs; https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerCreate |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
davechallis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
init
option is set in theHostConfig
struct; see https://github.com/docker/cli/blob/v24.0.7/cli/command/container/opts.go#L673-L676And
moby/api/types/container/hostconfig.go
Lines 472 to 473 in df59a35
And the API docs; https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerCreate