'Where does docker get the node version from?

In the Dockerfile I have specified the node:14.17.6-alpine3.13 version. In the deploy log the following version appears node:16.13.2-alpine. Does anyone know what is the reason for this? Or where to change this?

docker-compose deploy log:

[+] Building 20.1s (11/17)
 => [docker_nestjs-backend internal] load build definition from Dockerfile                                                    0.6s
 => => transferring dockerfile: 32B                                                                                           0.0s
 => [docker_angular-frontend internal] load build definition from Dockerfile                                                  0.7s
 => => transferring dockerfile: 32B                                                                                           0.0s
 => [docker_nestjs-backend internal] load .dockerignore                                                                       0.9s
 => => transferring context: 2B                                                                                               0.0s
 => [docker_angular-frontend internal] load .dockerignore                                                                     1.1s
 => => transferring context: 2B                                                                                               0.0s

 // HERE
 => [docker_angular-frontend internal] load metadata for docker.io/library/node:16.13.2-alpine                               11.8s
 // ^ at this line docker load metadata for 16.13.2-alpine but in dockerfile is node:14.17.6-alpine3.13 specified

 => CANCELED [docker_nestjs-backend internal] load build context                                                              6.9s
 => => transferring context: 113.92MB                                                                                         6.3s
 => [docker_angular-frontend development 1/6] FROM docker.io/library/node:16.13.2-alpine@sha256:2f50f4a428f8b5280817c9d4d896  0.0s
 => CACHED [docker_angular-frontend development 2/6] WORKDIR     /usr/src/app                                                 0.0s
 => [docker_angular-frontend internal] load build context                                                                     0.4s
 => => transferring context: 19.58kB                                                                                          0.0s
 => [docker_angular-frontend development 3/6] COPY        package*.json ./                                                    0.6s
 => ERROR [docker_angular-frontend development 4/6] RUN         npm ci                                                        5.6s

Dockerfile:

# -----------------------------------------------
# Development
# -----------------------------------------------
FROM        node:14.17.6-alpine3.13 AS development
WORKDIR     /usr/src/app
RUN         npm install -g @angular/[email protected]
COPY        package*.json ./
RUN         npm ci
COPY        . .
RUN         npm run build


# -----------------------------------------------
# Production
# -----------------------------------------------
FROM        httpd:2.4
ENV         TZ=Europe/Zurich
RUN         ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY        ./docker/copy-source/httpd.conf /usr/local/apache2/conf/httpd.conf
COPY        --from=development /usr/src/app/dist /usr/local/apache2/htdocs/

ENTRYPOINT  apachectl -DFOREGROUND

docker-compose.yml:

version: '3.8'
services:
  # -----------------------------------------------
  # Angular Frontend
  # -----------------------------------------------
  angular-frontend:
    build:
      dockerfile: Dockerfile
      context: ../angular-frontend
      target: development
    container_name: angular-frontend
    command: npm run start
    links:
      - nestjs-backend
    ports:
      - "4200:4200"
    restart: on-failure
    volumes:
      - ./angular-frontend:/usr/src/app/angular-frontend


Solution 1:[1]

This line docker_nestjs-backend development , shows that docker_nestjs-backend throws the error. You can change that to required configuration.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shaktirajsinh Jadeja