Skip to content

Commit 1963402

Browse files
xgalenknownasilya
authored andcommitted
fix: Allow multiple colons in the image's name (#46)
1 parent 8857bf4 commit 1963402

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/create-container.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ const inspect = require('util').inspect;
99
const stream = require('stream');
1010

1111
function isImageLocally(docker, image, done) {
12-
const withoutTag = image.split(':')[0];
12+
const imageSplitted = image.split(':');
13+
const withoutTag = imageSplitted.reduce((accum, current, index) => {
14+
if (index < imageSplitted.length - 1) {
15+
return `${accum}:${current}`;
16+
} else {
17+
return accum;
18+
}
19+
});
1320
const fullname = image === withoutTag ? `${image}:latest` : image;
1421

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

0 commit comments

Comments
 (0)