mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-18 17:00:25 +00:00
Share the docker socket via config.
This commit is contained in:
parent
959da25c9f
commit
0d2d372cb9
@ -10,11 +10,10 @@ Promise = require 'bluebird'
|
|||||||
JSONStream = require 'JSONStream'
|
JSONStream = require 'JSONStream'
|
||||||
PlatformAPI = require 'resin-platform-api/request'
|
PlatformAPI = require 'resin-platform-api/request'
|
||||||
|
|
||||||
DOCKER_SOCKET = '/run/docker.sock'
|
|
||||||
PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
|
PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
|
||||||
resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)
|
resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)
|
||||||
|
|
||||||
docker = Promise.promisifyAll(new Docker(socketPath: DOCKER_SOCKET))
|
docker = Promise.promisifyAll(new Docker(socketPath: config.dockerSocket))
|
||||||
# Hack dockerode to promisify internal classes' prototypes
|
# Hack dockerode to promisify internal classes' prototypes
|
||||||
Promise.promisifyAll(docker.getImage().__proto__)
|
Promise.promisifyAll(docker.getImage().__proto__)
|
||||||
Promise.promisifyAll(docker.getContainer().__proto__)
|
Promise.promisifyAll(docker.getContainer().__proto__)
|
||||||
|
@ -4,6 +4,7 @@ module.exports = config =
|
|||||||
pubnub:
|
pubnub:
|
||||||
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY
|
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY
|
||||||
publish_key: process.env.PUBNUB_PUBLISH_KEY
|
publish_key: process.env.PUBNUB_PUBLISH_KEY
|
||||||
|
dockerSocket: '/run/docker.sock'
|
||||||
expectedEnvVars: [
|
expectedEnvVars: [
|
||||||
'API_ENDPOINT'
|
'API_ENDPOINT'
|
||||||
'REGISTRY_ENDPOINT'
|
'REGISTRY_ENDPOINT'
|
||||||
|
@ -4,9 +4,8 @@ Promise = require 'bluebird'
|
|||||||
JSONStream = require 'JSONStream'
|
JSONStream = require 'JSONStream'
|
||||||
config = require './config'
|
config = require './config'
|
||||||
|
|
||||||
DOCKER_SOCKET = '/run/docker.sock'
|
|
||||||
|
|
||||||
docker = Promise.promisifyAll(new Docker(socketPath: DOCKER_SOCKET))
|
docker = Promise.promisifyAll(new Docker(socketPath: config.dockerSocket))
|
||||||
# Hack dockerode to promisify internal classes' prototypes
|
# Hack dockerode to promisify internal classes' prototypes
|
||||||
Promise.promisifyAll(docker.getImage().__proto__)
|
Promise.promisifyAll(docker.getImage().__proto__)
|
||||||
Promise.promisifyAll(docker.getContainer().__proto__)
|
Promise.promisifyAll(docker.getContainer().__proto__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user