improve path management
This commit is contained in:
parent
8c5cf3485a
commit
ddfd314a18
@ -26,6 +26,7 @@ let buildDockerFile = () => {
|
|||||||
baseImage:config.baseImage,
|
baseImage:config.baseImage,
|
||||||
command:config.command
|
command:config.command
|
||||||
});
|
});
|
||||||
|
plugins.smartfile.memory.toFsSync(JSON.stringify(dockerfile),paths.dockerfile);
|
||||||
return done.promise
|
return done.promise
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -34,6 +35,8 @@ let buildDockerFile = () => {
|
|||||||
*/
|
*/
|
||||||
let buildDockerImage = () => {
|
let buildDockerImage = () => {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
|
plugins.shelljs(`docker build -f ${paths.dockerfile} -v ${paths.cwd}:/workdir ${paths.assets}`);
|
||||||
|
done.resolve();
|
||||||
return done.promise
|
return done.promise
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
import * as plugins from "./npmdocker.plugins";
|
import * as plugins from "./npmdocker.plugins";
|
||||||
|
|
||||||
export let packageBase = plugins.path.join(__dirname,"../");
|
export let packageBase = plugins.path.join(__dirname,"../");
|
||||||
|
export let assets = plugins.path.join(packageBase,"assets/");
|
||||||
|
plugins.smartfile.fs.ensureDirSync(assets);
|
||||||
|
export let dockerfile = plugins.path.join(assets,"Dockerfile");
|
@ -16,6 +16,8 @@ export let dockerfileSnippet = (optionsArg:IDockerfileSnippet):string => {
|
|||||||
}
|
}
|
||||||
return `
|
return `
|
||||||
FROM ${optionsArg.baseImage}
|
FROM ${optionsArg.baseImage}
|
||||||
|
RUN mkdir /workspace
|
||||||
|
WORKDIR /workspace
|
||||||
cmd[${commandString}];
|
cmd[${commandString}];
|
||||||
`
|
`
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user