I am following the docker/getting-started tutorial, and when I do docker build -t getting-started .
, I believe the last line in the Dockerfile is skipped.
Dockerfile:
FROM node:12-alpine
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --production
COPY . .
CMD ["node", "src/index.js"]
docker build
user$ docker build -t getting-started .
[+] Building 17.5s (10/10) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 175B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 52B 0.0s
=> [internal] load metadata for docker.io/library/node:12-alpine 0.0s
=> [1/5] FROM docker.io/library/node:12-alpine 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 7.32kB 0.3s
=> CACHED [2/5] WORKDIR /app 0.0s
=> [3/5] COPY package.json yarn.lock ./ 0.1s
=> [4/5] RUN yarn install --production 15.1s
=> [5/5] COPY . . 0.1s
=> exporting to image 1.8s
=> => exporting layers 1.8s
=> => writing image sha256:65d56e5aebc4c0124f8342083c9df76692d58d8c1fa46a41eaf92a214eefab99 0.0s
=> => naming to docker.io/library/getting-started
What is the reason that the docker build output doesn't say [1/6], ... [6/6] and doesn't have a [6/6] CMD ["node", "src/index.js"]
line?
Edit:
This is the text from the tutorial (Also, image URL in comments):
Build the Docker image now using docker build -t getting-started .
again. This time, your output should look a little different.
Sending build context to Docker daemon 219.1kB
Step 1/6 : FROM node:12-alpine
---> b0dc3a5e5e9e
Step 2/6 : WORKDIR /app
---> Using cache
---> 9577ae713121
Step 3/6 : COPY package.json yarn.lock ./
---> Using cache
---> bd5306f49fc8
Step 4/6 : RUN yarn install --production
---> Using cache
---> 4e68fbc2d704
Step 5/6 : COPY . .
---> cccde25a3d9a
Step 6/6 : CMD ["node", "src/index.js"]
---> Running in 2be75662c150
Removing intermediate container 2be75662c150
---> 458e5c6f080c
Successfully built 458e5c6f080c
Successfully tagged getting-started:latest