必须将我们的AWS服务器从开放式互联网访问移至防火墙后面。我从头开始设置新服务器。我有一个脚本来构建和启动docker镜像。它在原始服务器上运行良好。然而,防火墙服务器,没有运气。
我试过“npm set strict-ssl false”和“npm install npm -g --ca = null”+“npm config set ca =”“”
我已经阅读了尽可能多的文档。没有任何工作,我现在卡住了......这是防火墙服务器的输出。
$ docker build . -t lab-server
Sending build context to Docker daemon 23.68 MB
Step 1 : FROM node:latest
---> 14989a19b2c6
Step 2 : RUN apt-get update -y
---> Using cache
---> bf64a1065712
Step 3 : RUN mkdir -p /usr/src/app
---> Using cache
---> 785f66509c34
Step 4 : WORKDIR /usr/src/app
---> Using cache
---> 621dfc200257
Step 5 : COPY package.json tsconfig.json /usr/src/app/
---> Using cache
---> 1dc06475df7f
Step 6 : RUN npm install
---> Running in 7cf8b7b036d6
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/body-parser failed, reason: self signed certificate in certificate chain
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-10-25T23_34_34_267Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
原始非防火墙服务器的输出。
Sending build context to Docker daemon 24.2 MB
Step 1 : FROM node:latest
---> ae884087f2da
Step 2 : RUN apt-get update -y
---> Using cache
---> 09c7c4a2471c
Step 3 : RUN mkdir -p /usr/src/app
---> Using cache
---> 67ed0cc97232
Step 4 : WORKDIR /usr/src/app
---> Using cache
---> 144e8824e6c1
Step 5 : COPY package.json tsconfig.json /usr/src/app/
---> Using cache
---> 2fe8ebeed67d
Step 6 : RUN npm install
---> Using cache
---> c69c300495f1
Step 7 : RUN npm install -g typescript ts-node
---> Using cache
---> 7c6c6a52eb39
Step 8 : COPY ./src /usr/src/app/src
---> Using cache
---> 90e5adf015dd
Step 9 : EXPOSE 3001
---> Using cache
---> f0689a44228c
Step 10 : CMD npm start
---> Using cache
---> 112ff47fc584
Successfully built 112ff47fc584
f84120db5167603fa2df12503b0ac331c65daf325d25c71203ca3bfb99dc0d1a
Server Started