Check if we have enough disk space for docker

Part of #642
This commit is contained in:
Girish Ramakrishnan
2019-08-12 20:38:24 -07:00
parent a843104348
commit 477ff424d6
2 changed files with 34 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ exports = module.exports = {
ping: ping,
info: info,
downloadImage: downloadImage,
createContainer: createContainer,
startContainer: startContainer,
@@ -621,3 +622,15 @@ function removeVolume(app, name, callback) {
callback();
});
}
function info(callback) {
assert.strictEqual(typeof callback, 'function');
let docker = exports.connection;
docker.info(function (error, result) {
if (error) return callback(new DockerError(DockerError.EXTERNAL_ERROR, 'Error connecting to docker. statusCode: ' + error.statusCode));
callback(null, result);
});
}