mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: make autoremove a variable in DockerManager
parent
4d2fa546cf
commit
2e940b3af7
|
@ -228,7 +228,7 @@ public class ComposedQuickStartRecordingService extends ComposedRecordingService
|
|||
List<Bind> binds = new ArrayList<>();
|
||||
binds.add(bind1);
|
||||
containerId = dockerManager.runContainer(properties.mediaNode(), container, containerName, null, volumes,
|
||||
binds, "host", envs, null, properties.shmSize(), false, null,
|
||||
binds, "host", envs, null, properties.shmSize(), false, null, true,
|
||||
openviduConfig.isOpenviduRecordingGPUEnabled());
|
||||
this.sessionsContainers.put(session.getSessionId(), containerId);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -164,7 +164,7 @@ public class ComposedRecordingService extends RecordingService {
|
|||
List<Bind> binds = new ArrayList<>();
|
||||
binds.add(bind1);
|
||||
containerId = dockerManager.runContainer(properties.mediaNode(), container, containerName, null, volumes,
|
||||
binds, "host", envs, null, properties.shmSize(), false, null,
|
||||
binds, "host", envs, null, properties.shmSize(), false, null, true,
|
||||
openviduConfig.isOpenviduRecordingGPUEnabled());
|
||||
} catch (Exception e) {
|
||||
this.cleanRecordingMaps(recording);
|
||||
|
|
|
@ -13,7 +13,8 @@ public interface DockerManager {
|
|||
|
||||
public String runContainer(String mediaNodeId, String image, String containerName, String user,
|
||||
List<Volume> volumes, List<Bind> binds, String networkMode, List<String> envs, List<String> command,
|
||||
Long shmSize, boolean privileged, Map<String, String> labels, boolean enableGPU) throws Exception;
|
||||
Long shmSize, boolean privileged, Map<String, String> labels, boolean autoremove, boolean enableGPU)
|
||||
throws Exception;
|
||||
|
||||
public void removeContainer(String mediaNodeId, String containerId, boolean force);
|
||||
|
||||
|
|
|
@ -127,7 +127,8 @@ public class LocalDockerManager implements DockerManager {
|
|||
@Override
|
||||
public String runContainer(String mediaNodeId, String image, String containerName, String user,
|
||||
List<Volume> volumes, List<Bind> binds, String networkMode, List<String> envs, List<String> command,
|
||||
Long shmSize, boolean privileged, Map<String, String> labels, boolean enableGPU) throws Exception {
|
||||
Long shmSize, boolean privileged, Map<String, String> labels, boolean autoremove, boolean enableGPU)
|
||||
throws Exception {
|
||||
|
||||
CreateContainerCmd cmd = dockerClient.createContainerCmd(image).withEnv(envs);
|
||||
if (containerName != null) {
|
||||
|
@ -138,7 +139,8 @@ public class LocalDockerManager implements DockerManager {
|
|||
cmd.withUser(user);
|
||||
}
|
||||
|
||||
HostConfig hostConfig = new HostConfig().withNetworkMode(networkMode).withPrivileged(privileged);
|
||||
HostConfig hostConfig = new HostConfig().withNetworkMode(networkMode).withPrivileged(privileged)
|
||||
.withAutoRemove(autoremove);
|
||||
if (shmSize != null) {
|
||||
hostConfig.withShmSize(shmSize);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue