Skip to content

Commit 1a751dd

Browse files
kingsodigiedpopp07
authored andcommitted
docs: add example Dockerfile (#924)
1 parent 3c32db0 commit 1a751dd

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Import Node base image (change version as needed)
2+
FROM node:12-slim
3+
4+
#Install the node SDK
5+
RUN npm install ibm-watson

docker/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Docker
2+
You can use docker to test issues you have with the SDK.
3+
4+
1. Install docker
5+
- Mac: <https://docs.docker.com/docker-for-mac/install/>
6+
- Windows: <https://docs.docker.com/docker-for-windows/install/>
7+
8+
2. Download the dockerfile for this SDK and edit as needed.
9+
- Change the node version as needed `FROM node:<your-version>`
10+
- For valid node base images on docker see <https://hub.docker.com/_/node>
11+
12+
- Copy code/file that you wish to test into the dockerfile
13+
- Add line `COPY <src>... <dest>`
14+
15+
- Set dockerfile to execute code file
16+
- Add line `CMD [ "<executable>" ]`
17+
18+
- For more information on dockerfile construction please visit <https://docs.docker.com/engine/reference/builder/>
19+
20+
3. Build and run the docker image.
21+
- Navigate to docker file directory
22+
- To build the docker image run `docker build --tag=<your-tag> .`
23+
- To run the docker image run `docker run <your-tag>`

0 commit comments

Comments
 (0)