1 | # Docker Info
|
2 |
|
3 | ## Description
|
4 |
|
5 | Repo contains a simple `Dockerfile` to create simple node container which can be used to test message output (which will differ from running locally on macOS)
|
6 |
|
7 | When building, note the tag name used `dev-node` to define container, this can be whatever you wish so long as it is also referenced when running container (see below)
|
8 |
|
9 | ## Important
|
10 |
|
11 | Make sure to use the `Dockerfile` and `.dockerignore` files contained in the repo
|
12 |
|
13 | ## Usage
|
14 |
|
15 | - Build Image
|
16 |
|
17 | ```bash
|
18 | > docker build -f docker/Dockerfile -t dev-node .
|
19 | Dockerfile tag build directory
|
20 | ```
|
21 |
|
22 | - Run container
|
23 |
|
24 | ```bash
|
25 | > docker run --name debug-ci -v$(pwd):/usr/src/app --rm -it dev-node ash -l
|
26 | ```
|
27 |
|
28 | _--name_ is local name as displayed in `docker ps`
|
29 |
|
30 | _-v_ is mounted volume so we can edit locally (destination is the same directory defined in `Dockerfile`)
|
31 |
|
32 | `dev-node` is the same name which was defined in build process
|
33 |
|
34 | ```bash
|
35 | > docker run --name debug-ci -v$(pwd):/usr/src/app --rm -it dev-node ash -l
|
36 | instance name $(pwd):work/dir container ash (apline bash) -l will load ~/.profile
|
37 | ```
|
38 |
|
39 | ### References
|