public void CreatePrivateEndpoints(Manifest cartridge) { if (cartridge == null) { throw new ArgumentNullException("cartridge"); } if (cartridge.Endpoints == null || cartridge.Endpoints.Count == 0) { return; } foreach (Endpoint endpoint in cartridge.Endpoints) { string privateIp = "0.0.0.0"; container.AddEnvVar(endpoint.PrivateIpName, privateIp); string port = container.ReadEnvVar("PRISON_PORT"); if (string.IsNullOrWhiteSpace(port)) { Logger.Error("No prison port available for gear {0}", this.container.Uuid); throw new Exception(string.Format("No prison port available for gear {0}", this.container.Uuid)); } container.AddEnvVar(endpoint.PrivatePortName, port); //if (!string.IsNullOrWhiteSpace(endpoint.WebsocketPortName) && !string.IsNullOrWhiteSpace(endpoint.WebsocketPort)) //{ // string websocketPort = endpoint.WebsocketPort == "0" ? Network.GrabEphemeralPort().ToString() : endpoint.WebsocketPort; // container.AddEnvVar(endpoint.WebsocketPortName, websocketPort); //} } }