fix(docker/containers): create container with bridge network [EE-6160] (#10365)

pull/10347/head
Chaim Lev-Ari 2023-09-25 19:35:54 +03:00 committed by GitHub
parent 26cb75def9
commit 9dde610da3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -441,9 +441,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
networks.push({ Name: 'container' });
$scope.availableNetworks = networks.sort((a, b) => a.Name.localeCompare(b.Name));
if (_.find(networks, { Name: 'nat' })) {
$scope.config.HostConfig.NetworkMode = 'nat';
}
$scope.formValues.network = networkTabUtils.getDefaultViewModel(networks.some((network) => network.Name === 'bridge'));
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve networks');