Skip to content

Commit

Permalink
fix: Allow multiple colons in the image's name (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgalen authored and knownasilya committed Dec 11, 2017
1 parent 8857bf4 commit 1963402
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/create-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ const inspect = require('util').inspect;
const stream = require('stream');

function isImageLocally(docker, image, done) {
const withoutTag = image.split(':')[0];
const imageSplitted = image.split(':');
const withoutTag = imageSplitted.reduce((accum, current, index) => {
if (index < imageSplitted.length - 1) {
return `${accum}:${current}`;
} else {
return accum;
}
});
const fullname = image === withoutTag ? `${image}:latest` : image;

docker.listImages({filter: withoutTag}, function (err, images) {
Expand Down

0 comments on commit 1963402

Please sign in to comment.