|
|
@@ -23,7 +23,16 @@ public class DockerPack implements CodePacker {
|
|
|
|
|
|
@Override
|
|
|
public String pack(String appId, String commitId, String appRootPath, String dockerfile) throws Exception {
|
|
|
- String repo = targetPath + File.separator + appId;
|
|
|
+ int idx = targetPath.lastIndexOf("/");
|
|
|
+ String appId1 = targetPath.substring(idx+1);
|
|
|
+ String repo;
|
|
|
+ if (appId1.equals(appId)) {
|
|
|
+ repo = targetPath;
|
|
|
+ } else {
|
|
|
+ repo = targetPath + File.separator + appId;
|
|
|
+ }
|
|
|
+
|
|
|
+ //String repo = targetPath + File.separator + appId;
|
|
|
String image = repo + ":" + commitId;
|
|
|
docker.build(image, appRootPath, dockerfile);
|
|
|
return image;
|