[英]where are repo's automated build files located
On an automated build, how can I access the files from my private repo? 在自动构建中,如何从私有存储库访问文件?
Ex if I have a Dockerfile with: 例如,如果我有一个Dockerfile:
FROM node:4.1.1
npm install
Where are the files from my repo located? 我的仓库中的文件位于何处?
If your Dockerfile has only: 如果您的Dockerfile只有:
FROM node:4.1.1
npm install
That won't involve any git repo (public or private) 这不会涉及任何git仓库(公共或私人)
You could add a RUN git clone git@bitbucket:myaccount/myprivaterepo /path/to/repo
directive. 你可以添加一个
RUN git clone git@bitbucket:myaccount/myprivaterepo /path/to/repo
指令。
Or you can follow the official docker node image instruction : 或者您可以按照官方docker节点图像说明 :
Create a Dockerfile in your Node.js app project
在Node.js应用程序项目中创建一个Dockerfile
FROM node:0.10-onbuild
# replace this with your application's default port
EXPOSE 8888
You can then build and run the Docker image:
然后,您可以构建并运行Docker镜像:
$ docker build -t my-nodejs-app .
$ docker run -it --rm --name my-running-app my-nodejs-app
In that case, your node app will be in /usr/src/app
. 在这种情况下,您的节点应用程序将位于
/usr/src/app
。
See onbuild/Dockerfile
: 请参阅
onbuild/Dockerfile
:
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ONBUILD COPY package.json /usr/src/app/
ONBUILD RUN npm install
ONBUILD COPY . /usr/src/app
The image assumes that your application has a file named
package.json
listing its dependencies and defining its start script .该映像假定您的应用程序有一个名为
package.json
的文件,列出其依赖关系并定义其启动脚本 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.