An error occurred in Docker document Quickstart part2
In the part of $ docker build --tag bulletinboard: 1.0 .
Step 4/7 : RUN npm install
---> Running in 1a42d2b3c5dd
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.8
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.8>
npm notice Run `npm install -g [email protected]` to update!
npm notice
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/vue reason: Unexpected token � in JSON at position 70253
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-05T12_02_36_331Z-debug.log
Install Node.js and npm directly Installation method After installation, set at the following site How to check the Path of Node.js [for beginners] Also, control panel> system> advanced system settings (lower left)> environment variables> edit the path of system variables and add C: \ Program Files \ nodejs \ (maybe it is done automatically)
Delete the package-lock.json
file in the bulletin-board-app
file
Run $ docker build --tag bulletinboard: 1.0 .
I still got the error, so on line 5 of the dockerfile RUN npm cache verify
FROM node:current-slim
WORKDIR /usr/src/app
COPY package.json .
RUN npm cache verify
RUN npm install
EXPOSE 8080
CMD [ "npm", "start" ]
COPY . .
$ docker build --tag bulletinboard:1.0 .
Sending build context to Docker daemon 12.03MB
Step 1/8 : FROM node:current-slim
---> 922b09b21278
Step 2/8 : WORKDIR /usr/src/app
---> Using cache
---> 5d3d82eda8ed
Step 3/8 : COPY package.json .
---> Using cache
---> 7cc831630440
Step 4/8 : RUN npm cache verify
---> Using cache
---> 54aab39eb76b
Step 5/8 : RUN npm install
---> Using cache
---> b6e782bc92e7
Step 6/8 : EXPOSE 8080
---> Using cache
---> baf0c121f375
Step 7/8 : CMD [ "npm", "start" ]
---> Using cache
---> 5fcb2b27e8f0
Step 8/8 : COPY . .
---> b02d075c5110
Successfully built b02d075c5110
Successfully tagged bulletinboard:1.0
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Last
Ignore SECURITY WARNING: ~~~~
It is better to acquire more knowledge of Node.js etc.
Recommended Posts