 localImage = config.localImage
 remoteImage = config.remoteImage
 
-getContainerId = ->
+containerIdPromise =
 	fs.readFileAsync( '/proc/1/cgroup' )
 	.then (data) ->
 		data.toString().match( /:cpu:\/docker\/(.*)$/m )[1]
 	.catch (err) ->
 		return process.env.HOSTNAME
 
-currentContainer = getContainerId().then (containerId) ->
+currentContainerPromise =
+	containerIdPromise.then (containerId) ->
 		docker.getContainer(containerId)
 
 startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->

			console.log('And process.exiting..')
			process.exit()

currentSupervisorConfig = currentContainer.then (container) ->
	container.inspectAsync()
.tap (currentSupervisor) ->
	# The volume keys are the important bit.

		restart()

# This is a promise that resolves when we have fully initialised.
exports.initialised = currentConfigPromise.then (currentSupervisor) ->
	utils = require './utils'
	JSONStream = require 'JSONStream'

