skip downloading image if image present locally
if we use build service app locally (without push), then we can skip the download altogether.
This commit is contained in:
@@ -170,13 +170,19 @@ function downloadImage(manifest, callback) {
|
||||
|
||||
debug('downloadImage %s', manifest.dockerImage);
|
||||
|
||||
var attempt = 1;
|
||||
const image = gConnection.getImage(manifest.dockerImage);
|
||||
|
||||
async.retry({ times: 10, interval: 5000, errorFilter: e => e.reason !== BoxError.NOT_FOUND }, function (retryCallback) {
|
||||
debug('Downloading image %s. attempt: %s', manifest.dockerImage, attempt++);
|
||||
image.inspect(function (error, result) {
|
||||
if (!error && result) return callback(null); // image is already present locally
|
||||
|
||||
pullImage(manifest, retryCallback);
|
||||
}, callback);
|
||||
let attempt = 1;
|
||||
|
||||
async.retry({ times: 10, interval: 5000, errorFilter: e => e.reason !== BoxError.NOT_FOUND }, function (retryCallback) {
|
||||
debug('Downloading image %s. attempt: %s', manifest.dockerImage, attempt++);
|
||||
|
||||
pullImage(manifest, retryCallback);
|
||||
}, callback);
|
||||
});
|
||||
}
|
||||
|
||||
function getBindsSync(app) {
|
||||
|
||||
Reference in New Issue
Block a user