Skip to content

Equivalent of "docker run --init" using the Go SDK? #46883

Answered by thaJeztah
davechallis asked this question in Q&A
Discussion options

You must be logged in to vote

The init option is set in the HostConfig struct; see https://github.com/docker/cli/blob/v24.0.7/cli/command/container/opts.go#L673-L676

And

// Run a custom init inside the container, if null, use the daemon's configured settings
Init *bool `json:",omitempty"`

And the API docs; https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerCreate

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@davechallis
Comment options

Answer selected by davechallis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants