mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 00:45:23 +00:00
fix: Only join the default network when creating the container
We were joining every network on container creation, which is currently bugged in Docker. We were also joining networks afterwards, so the non-default networks are joined post-creation, and only the networkMode container is joined on creation. Change-type: patch Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
parent
06bbf9751a
commit
367dd876aa
@ -114,8 +114,6 @@ module.exports = class ServiceManager extends EventEmitter
|
||||
# TODO: Don't mutate service like this, use an interface
|
||||
service.config.environment['RESIN_DEVICE_NAME_AT_INIT'] = deviceName
|
||||
|
||||
nets = service.extraNetworksToJoin()
|
||||
|
||||
@logger.logSystemEvent(logTypes.installService, { service })
|
||||
@reportNewStatus(mockContainerId, service, 'Installing')
|
||||
|
||||
|
@ -99,7 +99,6 @@ export class Service {
|
||||
// We don't need this value
|
||||
delete appConfig.commit;
|
||||
|
||||
|
||||
// Get rid of any extra values and report them to the user
|
||||
const config = sanitiseComposeConfig(appConfig);
|
||||
|
||||
@ -493,6 +492,11 @@ export class Service {
|
||||
tmpFs[tmp] = '';
|
||||
});
|
||||
|
||||
const mainNetwork = _.pickBy(
|
||||
this.config.networks,
|
||||
(_v, k) => k === this.config.networkMode,
|
||||
) as ServiceConfig['networks'];
|
||||
|
||||
return {
|
||||
Tty: this.config.tty,
|
||||
Cmd: this.config.command,
|
||||
@ -503,7 +507,7 @@ export class Service {
|
||||
ExposedPorts: exposedPorts,
|
||||
Image: this.config.image,
|
||||
Labels: this.config.labels,
|
||||
NetworkingConfig: ComposeUtils.serviceNetworksToDockerNetworks(this.config.networks),
|
||||
NetworkingConfig: ComposeUtils.serviceNetworksToDockerNetworks(mainNetwork),
|
||||
StopSignal: this.config.stopSignal,
|
||||
Domainname: this.config.domainname,
|
||||
Hostname: this.config.hostname,
|
||||
|
Loading…
x
Reference in New Issue
Block a user