Class DockerCreateContainer.HostConfig
java.lang.Object
com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer.HostConfig
- Enclosing class:
- DockerCreateContainer
- Since:
- 6.0.0
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAutomatically remove the container when the container's process exits.final MapProperty<String,
String> getBinds()
final ListProperty<String>
final ListProperty<String>
final ListProperty<String>
final ListProperty<String>
getDns()
final ListProperty<String>
final ListProperty<String>
A list of additional groups that the container process will run as.The IPC mode for the container.final ListProperty<String>
getLinks()
final ListProperty<String>
Size of/dev/shm
in bytes.final MapProperty<String,
String> The namespaced kernel parameters (sysctls) in the container.final MapProperty<String,
String> getTmpFs()
Docker container tmpfs support.final ListProperty<String>
void
void
restartPolicy
(String name, int maximumRetryCount)
-
Constructor Details
-
HostConfig
-
-
Method Details
-
getGroups
A list of additional groups that the container process will run as. -
getMemory
-
getMemorySwap
-
getCpuset
-
getDns
-
getNetwork
-
getLinks
-
getVolumesFrom
-
getPortBindings
-
getPublishAll
-
getBinds
-
getTmpFs
Docker container tmpfs support.The key of this map is the container target path, the value stores the tmpfs comma-separated options.
For example, to create a temporary 50MB writeable non executable filesystem mounted under /data in the container:
tmpFs = ['/data': 'rw,noexec,size=50m']
- Since:
- 8.0.0
-
getExtraHosts
-
getLogConfig
-
getPrivileged
-
getRestartPolicy
-
getDevices
-
getCapAdd
- Since:
- 8.1.0
-
getCapDrop
- Since:
- 8.1.0
-
getShmSize
Size of/dev/shm
in bytes.The size must be greater than 0. If omitted the system uses 64MB.
-
getAutoRemove
Automatically remove the container when the container's process exits.This has no effect if
restartPolicy
is set. -
getIpcMode
The IPC mode for the container.none
- Own private IPC namespace, with /dev/shm not mounted.private
- Own private IPC namespace.shareable"
- Own private IPC namespace, with a possibility to share it with other containers.container <_name-or-ID_>
- Join another ("shareable") container’s IPC namespace.host
- Use the host system’s IPC namespace.
-
getSysctls
The namespaced kernel parameters (sysctls) in the container.For example, to turn on IP forwarding in the containers network namespace:
sysctls = ['net.ipv4.ip_forward':'1']
Note:
- Not all sysctls are namespaced.
- Docker does not support changing sysctls inside of a container that also modify the host system.
-
logConfig
-
restartPolicy
-