 			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()
+		console.log('Removing our container and letting the new supervisor take over')
+		currentContainer.then (container) ->
+			container.removeAsync(force: true)
+		.finally ->
+			# This should never really be reached as docker should already have terminated us,
+			# but in case it hasn't, then we'll just commit harakiri
+			console.log('And process.exiting..')
+			process.exit()
 
-currentSupervisor = getCurrentContainer().tap (currentSupervisor) ->
+currentSupervisorConfig = currentContainer.then (container) ->
+	container.inspectAsync()
+.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 = currentSupervisor.then (currentSupervisor) ->
	utils = require './utils'
	JSONStream = require 'JSONStream'


	.catch (err) ->
		return process.env.HOSTNAME

currentContainer = getContainerId().then (containerId) ->
		docker.getContainer(containerId)

startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->
	console.log('Creating supervisor container:', localImage)
