mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: Add user argument to DockerManager
parent
555aee1e57
commit
cc0479deb3
|
@ -178,7 +178,8 @@ public class ComposedRecordingService extends RecordingService {
|
|||
List<Bind> binds = new ArrayList<>();
|
||||
binds.add(bind1);
|
||||
binds.add(bind2);
|
||||
containerId = dockerManager.runContainer(container, containerName, volumes, binds, "host", envs, null);
|
||||
containerId = dockerManager.runContainer(container, containerName, null,
|
||||
volumes, binds, "host", envs, null);
|
||||
containers.put(containerId, containerName);
|
||||
} catch (Exception e) {
|
||||
this.cleanRecordingMaps(recording);
|
||||
|
|
|
@ -103,7 +103,7 @@ public class DockerManager {
|
|||
}
|
||||
}
|
||||
|
||||
public String runContainer(String container, String containerName, List<Volume> volumes, List<Bind> binds,
|
||||
public String runContainer(String container, String containerName, String user, List<Volume> volumes, List<Bind> binds,
|
||||
String networkMode, List<String> envs, List<String> command) throws Exception {
|
||||
|
||||
CreateContainerCmd cmd = dockerClient.createContainerCmd(container).withEnv(envs);
|
||||
|
@ -111,6 +111,10 @@ public class DockerManager {
|
|||
cmd.withName(containerName);
|
||||
}
|
||||
|
||||
if (user != null) {
|
||||
cmd.withUser(user);
|
||||
}
|
||||
|
||||
HostConfig hostConfig = new HostConfig().withNetworkMode(networkMode);
|
||||
if (volumes != null) {
|
||||
cmd.withVolumes(volumes);
|
||||
|
|
Loading…
Reference in New Issue