diff --git a/app/docker/views/containers/create/createContainerController.js b/app/docker/views/containers/create/createContainerController.js index 625bbf0ca..9a10f258a 100644 --- a/app/docker/views/containers/create/createContainerController.js +++ b/app/docker/views/containers/create/createContainerController.js @@ -502,7 +502,11 @@ angular.module('portainer.docker').controller('CreateContainerController', [ } deviceRequest.Capabilities = [gpuOptions.capabilities]; - config.HostConfig.DeviceRequests.push(deviceRequest); + if (config.HostConfig.DeviceRequests) { + config.HostConfig.DeviceRequests.push(deviceRequest); + } else { + config.HostConfig.DeviceRequests = [deviceRequest]; + } } function prepareConfiguration() {