我正在尝试为使用yarn安装依赖项的node应用程序构建docker镜像。我的Dockerfile如下:
FROM node:7
WORKDIR /app
COPY package.json /app
RUN yarn install
COPY . /app
CMD npm run develop
EXPOSE 8000
当我在本地机器上运行yarn install时,一切都正常,但是当我进行docker构建时,我会遇到这个错误导致程序一直阻塞。
**docker build -t rs .**
Sending build context to Docker daemon 219.1MB
Step 1/7 : FROM node:7
---> d9aed20b68a4
Step 2/7 : WORKDIR /reason
---> Using cache
---> fe51a1860989
Step 3/7 : COPY package.json /reason
---> Using cache
---> b0e136ee6eeb
Step 4/7 : RUN yarn install
---> Running in e273f8cf1f3e
yarn install v0.24.4
info No lockfile found.
[1/4] Resolving packages...
Couldn't find any versions for "glamor" that matches "next"
? Please choose a version of "glamor" from this list: (Use arrow keys)
❯ 2.20.40
2.20.39
2.20.38
2.20.37
2.20.36
2.20.35
2.20.34
(Move up and down to reveal more choices)warning glamor@3.0.0-3: abandoned, please use v2 instead
warning gatsby-plugin-glamor > glamor-inline@1.0.5: use glamor/inline instead
warning gatsby-plugin-glamor > glamor-react > glamor@3.0.0-3: abandoned, please use v2 instead
warning gatsby-plugin-glamor > glamor-server > glamor@3.0.0-3: abandoned, please use v2 instead
warning gatsby > babel-preset-es2015@6.24.1: Thanks for using Babel: we recommend using babel-preset-env now:
请阅读 babeljs.io/env 进行更新!
控制台一直停留在这个阶段,我该如何修复?