Skip to content
Snippets Groups Projects

Add a memory limit to Docker containers

2 files
+ 33
1
Compare changes
  • Side-by-side
  • Inline

Files

@@ -53,6 +53,20 @@ public class DockerApi {
return res.get("Id").getAsString();
}
/**
* Creates a new Docker container.
*
* @param name the name of the container
* @param config the container configuration, passed as-is
*
* @return the ID of the container
*/
public String createContainer(final String name, final Map<String, Object> config) {
final var res = this.api.postWithJson("/containers/create?name=" + name, config);
return res.get("Id").getAsString();
}
/**
* Starts the container.
*
Loading