Skip to content

Commit 12a64fa

Browse files
Merge pull request docker#54 from klintzz/patch-1
Dockerfile CMD path fix
2 parents d4da770 + 631465e commit 12a64fa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/tutorial/image-building-best-practices/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ command, you can see the command that was used to create each layer within an im
1515

1616
```plaintext
1717
IMAGE CREATED CREATED BY SIZE COMMENT
18-
a78a40cbf866 18 seconds ago /bin/sh -c #(nop) CMD ["node" "/app/src/ind… 0B
18+
a78a40cbf866 18 seconds ago /bin/sh -c #(nop) CMD ["node" "src/index.j… 0B
1919
f1d1808565d6 19 seconds ago /bin/sh -c yarn install --production 85.4MB
2020
a2c054d14948 36 seconds ago /bin/sh -c #(nop) COPY dir:5dc710ad87c789593… 198kB
2121
9577ae713121 37 seconds ago /bin/sh -c #(nop) WORKDIR /app 0B
@@ -56,7 +56,7 @@ FROM node:12-alpine
5656
WORKDIR /app
5757
COPY . .
5858
RUN yarn install --production
59-
CMD ["node", "/app/src/index.js"]
59+
CMD ["node", "src/index.js"]
6060
```
6161
6262
Going back to the image history output, we see that each command in the Dockerfile becomes a new layer in the image.
@@ -76,7 +76,7 @@ a change to the `package.json`. Make sense?
7676
COPY package.json yarn.lock ./
7777
RUN yarn install --production
7878
COPY . .
79-
CMD ["node", "/app/src/index.js"]
79+
CMD ["node", "src/index.js"]
8080
```
8181

8282
1. Create a file named `.dockerignore` in the same folder as the Dockerfile with the following contents.
@@ -125,7 +125,7 @@ a change to the `package.json`. Make sense?
125125
---> 4e68fbc2d704
126126
Step 5/6 : COPY . .
127127
---> a239a11f68d8
128-
Step 6/6 : CMD ["node", "/app/src/index.js"]
128+
Step 6/6 : CMD ["node", "src/index.js"]
129129
---> Running in 49999f68df8f
130130
Removing intermediate container 49999f68df8f
131131
---> e709c03bc597
@@ -154,7 +154,7 @@ a change to the `package.json`. Make sense?
154154
---> 4e68fbc2d704
155155
Step 5/6 : COPY . .
156156
---> cccde25a3d9a
157-
Step 6/6 : CMD ["node", "/app/src/index.js"]
157+
Step 6/6 : CMD ["node", "src/index.js"]
158158
---> Running in 2be75662c150
159159
Removing intermediate container 2be75662c150
160160
---> 458e5c6f080c

docs/tutorial/our-application/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ see a few flaws in the Dockerfile below. But, don't worry! We'll go over them.
4141
WORKDIR /app
4242
COPY . .
4343
RUN yarn install --production
44-
CMD ["node", "/app/src/index.js"]
44+
CMD ["node", "src/index.js"]
4545
```
4646

4747
Please check that the file `Dockerfile` has no file extension like `.txt`. Some editors may append this file extension automatically and this would result in an error in the next step.

0 commit comments

Comments
 (0)