diff --git a/container.go b/container.go index 7fb977acfb..21c040b8eb 100644 --- a/container.go +++ b/container.go @@ -121,7 +121,7 @@ type ContainerRequest struct { AlwaysPullImage bool // Always pull image ImagePlatform string // ImagePlatform describes the platform which the image runs on. Binds []string // Deprecated: Use PreCreateModifier instead - ShmSize int64 // Deprecated: Use PreCreateModifier instead. Amount of memory shared with the host (in bytes) + ShmSize int64 // Amount of memory shared with the host (in bytes) CapAdd []string // Deprecated: Use PreCreateModifier instead. Add Linux capabilities CapDrop []string // Deprecated: Use PreCreateModifier instead. Drop Linux capabilities PreCreateModifier func(*container.HostConfig, map[string]*network.EndpointSettings) // Modifier for the host config and network settings before container creation diff --git a/docker.go b/docker.go index 86f14f6641..ef0de3d3ea 100644 --- a/docker.go +++ b/docker.go @@ -1049,6 +1049,7 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque hostConfig := &container.HostConfig{ Privileged: req.Privileged, + ShmSize: req.ShmSize, Tmpfs: req.Tmpfs, } diff --git a/lifecycle.go b/lifecycle.go index eec99d3365..0588c4b98c 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -72,6 +72,5 @@ func defaultPreCreateModifier(req ContainerRequest) func(hostConfig *container.H hostConfig.ExtraHosts = req.ExtraHosts hostConfig.NetworkMode = req.NetworkMode hostConfig.Resources = req.Resources - hostConfig.ShmSize = req.ShmSize } }