Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set Shared Memory size (shmSize) for ContainerRequest #228

Closed
chambodn opened this issue Jul 10, 2020 · 3 comments
Closed

Allow to set Shared Memory size (shmSize) for ContainerRequest #228

chambodn opened this issue Jul 10, 2020 · 3 comments

Comments

@chambodn
Copy link

Would it be possible to add the option to specify shmSize when defining a testcontainers.ContainerRequest?
This is especially useful for when starting docker images with some active prerequisites (in my case solace/solace-pubsub-standard.

@mdelapenya
Copy link
Collaborator

Hey, sorry for the radio silence. :/ since #402, we are supporting configuring the host resources, which are mapped to https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/api/types/container/host_config.go#L341

Is this what you are looking for?

@mdelapenya
Copy link
Collaborator

Hi @chambodn I think this issue can be closed, as since #461 it's possible to set the shmSize of a container.

On the other hand, it would be great that, instead of setting the shmSize attribute, we define a consistent manner of building a HostConfig struct. We currently do this, building it from several sources:

	hostConfig := &container.HostConfig{
		ExtraHosts:   req.ExtraHosts,
		PortBindings: exposedPortMap,
		Binds:        req.Binds,
		Mounts:       mounts,
		Tmpfs:        req.Tmpfs,
		AutoRemove:   req.AutoRemove,
		Privileged:   req.Privileged,
		NetworkMode:  req.NetworkMode,
		Resources:    req.Resources,
		ShmSize:      req.ShmSize,
	}

wdyt? Would you be interested in participating in the refactor?

@mdelapenya
Copy link
Collaborator

Closing, as shmSize can be added since the already released v0.14.0.

About #228 (comment), we can open a new issue for that if needed.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants