NPM Install and Docker Build within same job in gitlab-ci.yml

Hi GitLab Community

During my pipeline, I would like to execute semantic-release that tags the built container and pushes it into the GitLab registry.

An issue that I’m facing is that I cannot execute npm install and docker build within the same job.
Here is my gitlab-ci.yml file:

image: docker:19.03.8

stages:
- build

variables:
  DOCKER_TLS_CERTDIR: "/certs"
  
services:
  - docker:19.03.8-dind

before_script:
  - docker info

release:
  stage: build
  image: node:latest
  before_script:
    - node -v
    - npm install
    - docker build -t $CI_REGISTRY_IMAGE .
  script:
    - npx semantic-release

The pipeline return that the docker command cannot be found, which makes sense as it’s using the node:latest image, but how can I use the docker build command within the job?

54 $ docker build -t $CI_REGISTRY_IMAGE .
55 /bin/bash: line 99: docker: command not found

I appreciate your help!