mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-19 11:16:34 +00:00
Use the DOCKER_SOCKET env var for the user container's balena socket mount
Instead of hardcoding balena.sock we use this variable since the path changes with the balena -> balenaEngine rename. We keep also mounting into balena.sock for backwards compatibility (even though most tools should transparently use the DOCKER_HOST env var). Change-type: minor Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
parent
46535028c1
commit
31e730600d
@ -323,9 +323,13 @@ export function addFeaturesFromLabels(
|
||||
}
|
||||
|
||||
if (checkTruthy(service.config.labels['io.balena.features.balena-socket'])) {
|
||||
service.config.volumes.push('/var/run/balena.sock:/var/run/balena.sock');
|
||||
service.config.volumes.push(`${constants.dockerSocket}:${constants.dockerSocket}`);
|
||||
if (service.config.environment['DOCKER_HOST'] == null) {
|
||||
service.config.environment['DOCKER_HOST'] = 'unix:///var/run/balena.sock';
|
||||
service.config.environment['DOCKER_HOST'] = `unix://${constants.dockerSocket}`;
|
||||
}
|
||||
// We keep balena.sock for backwards compatibility
|
||||
if (constants.dockerSocket != '/var/run/balena.sock') {
|
||||
service.config.volumes.push(`${constants.dockerSocket}:/var/run/balena.sock`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user