I am trying to build an image for an express app and I have issues running the command. The error indicates that the package.json
file is not accessible. Please look at the structure error
below.
Sending build context to Docker daemon 2.048kB
Step 1/7 : FROM node:8-alpine
---> 2b8fcdc6230a
Step 2/7 : WORKDIR /usr/src/app
---> Using cache
---> d0f2d783ba5a
Step 3/7 : COPY package*.json ./
COPY failed: no source files were specified
Also, the docker file is shown below:
FROM node:8-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]
Then lastly the file structure is shown below:
I'd like any assistance possible. Thanks.
question from:
https://stackoverflow.com/questions/65844113/solving-the-error-of-docker-build-not-accesing-package-json 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…