Getting error while copying tar file in Dockerfile which is generated by build runner in .gitlab-ci.yml

Hi All,

I am facing issue with the copying of tarball file in dockerfile on gitlab which is generated by .gitlab-ci.yml build runner.
Can anyone please help.

  1. Modify .gitlab-ci.yml to build and pack npm package into tarball file.

first step achieved and working file in pipeline by below code in .gitlab-ci.yml

build:
stage: build
script:
- npm pack -----------> this generates the ‘node-red-contrib-ruby-red-1.0.0.tgz’ of project
tags:
- build

  1. Modify dockerfile to copy created tarball file into image run npm install in docker file for that created tarball file

But doing the second step getting build error in Dockerfile.

COPY node-red-contrib-ruby-red-1.0.0.tgz . ----------> getting error on this line
RUN npm install node-red-contrib-ruby-red@1.0.0

error---->COPY failed: file not found in build context or excluded by .dockerignore: stat node-red-contrib-ruby-red-1.0.0.tgz: file does not exist

Thanks,
Sudarshan Thakur