 	.catch (err) ->
 		return process.env.HOSTNAME
 
-getCurrentContainer = ->
-	getContainerId().then (containerId) ->
-		docker.getContainer(containerId).inspectAsync()
+currentContainer = getContainerId().then (containerId) ->
+		docker.getContainer(containerId)
 
 startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->
 	console.log('Creating supervisor container:', localImage)

			throw e
	.then ->
		# We've started the new container, so we're done here! #pray
		console.log('Exiting to let the new supervisor take over')
		process.exit()

currentSupervisor = getCurrentContainer().tap (currentSupervisor) ->
	# The volume keys are the important bit.
	expectedVolumes = _.sortBy(_.keys(config.supervisorContainer.Volumes))
	actualVolumes = _.sortBy(_.keys(currentSupervisor.Volumes))

		restart()

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

