波波老师,windows环境下dockercompose报错了。
Building myaccount-service
Step 1/13 : FROM node:alpine as builder
---> 59be7d262786
Step 2/13 : WORKDIR '/build'
---> Using cache
---> ef355f2740bb
Step 3/13 : COPY myaccount ./myaccount
---> Using cache
---> 163c1fd5ce7f
Step 4/13 : COPY resources ./resources
---> Using cache
---> 5a249647ae46
Step 5/13 : COPY third_party ./third_party
---> Using cache
---> 919aa3c96e16
Step 6/13 : WORKDIR '/build/myaccount'
---> Using cache
---> 071d45a27978
Step 7/13 : RUN npm install
---> Using cache
---> 2b9129e1d693
Step 8/13 : RUN npm rebuild node-sass
---> Running in f7cd735f6ebe
> node-sass@4.12.0 install /build/myaccount/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_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
> node-sass@4.12.0 postinstall /build/myaccount/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /build/myaccount/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/usr/local/bin/node',
...
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-11-03T02_26_30_084Z-debug.log
ERROR: Service 'myaccount-service' failed to build: The command '/bin/sh -c npm rebuild node-sass' returned a non-zero code: 1
展开
作者回复: 你好,Staffjoy的前端构建是要求Linux或者Mac环境的,如果是Windows环境,有几个办法可以尝试:
1. 安装Linux虚拟机(比如用Vagrant),在虚拟机里头构建。
2. 有学员给出了一个在windows构建的修复方案(https://github.com/spring2go/staffjoy/issues/6),可以尝试下
3. 跳过构建,直接用波波已经打好的镜像(https://hub.docker.com/u/boboweike),构建实际就是生成静态的html/js文件,然后放在nginx目录下,打成镜像,这步骤理解即可,没必要完全动手操作。