Reputation: 369
On an automated build, how can I access the files from my private repo?
Ex if I have a Dockerfile with:
FROM node:4.1.1
npm install
Where are the files from my repo located?
Upvotes: 3
Views: 52
Reputation: 1327726
If your Dockerfile has only:
FROM node:4.1.1
npm install
That won't involve any git repo (public or private)
You could add a RUN git clone git@bitbucket:myaccount/myprivaterepo /path/to/repo
directive.
Or you can follow the official docker node image instruction:
Create a Dockerfile in your Node.js app project
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 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
.
See 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.
Upvotes: 2