【问题标题】:Docker Build cannot download https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.nodeDocker Build 无法下载 https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
【发布时间】:2019-07-10 09:01:06
【问题描述】:

我看过类似的帖子,但没有人使用 docker。我在进行 docker build 时遇到问题:

运行命令时:

docker build -t frontend -f frontendDockerfile .

我明白了:

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

这是我的前端DockerFile:

FROM node

COPY /frontend/Express /Express

WORKDIR /Express

#RUN npm install && npm rebuild node-sass && npm run webpack
RUN npm install  && npm run webpack

CMD ["npm", "start"]

EXPOSE 3000

如果有人可以帮助我,我将非常感激。

【问题讨论】:

    标签: docker npm node-sass


    【解决方案1】:

    这个特定的包是一个重定向,所以如果你在防火墙后面,你需要允许访问:

    https://github-production-release-asset-2e65be.s3.amazonaws.com

    【讨论】:

      【解决方案2】:

      根据answer,您收到此错误是因为您使用的是节点 v12。
      这是真的,因为最新的 docker 标签也引用了节点 12。

      切换到节点 11 似乎可以解决问题。
      因此,您可以尝试修改您的基础图像:

      FROM node:11
      
      COPY /frontend/Express /Express
      
      WORKDIR /Express
      ...
      

      【讨论】:

        猜你喜欢
        • 2019-06-18
        • 2021-10-21
        • 1970-01-01
        • 1970-01-01
        • 2019-06-24
        • 1970-01-01
        • 1970-01-01
        • 2018-03-29
        相关资源
        最近更新 更多