rancher的编译-2
接上一篇,rancher的编译-1,因为整个 rancher 是有 Makefile 的,所以正常来说一个 make
命令也可以让你进行编译。
执行一下 make
然后报错了。
Step 12/43 : RUN zypper -n install gcc binutils glibc-devel-static ca-certificates git-core wget curl unzip tar vim less file xz gzip sed gawk iproute2 iptables jq
---> Running in 748aca0d5ac9
crypto/fips/fips.c:524: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE
The command '/bin/sh -c zypper -n install gcc binutils glibc-devel-static ca-certificates git-core wget curl unzip tar vim less file xz gzip sed gawk iproute2 iptables jq' returned a non-zero code: 139
FATA[0260] exit status 139
https://access.redhat.com/discussions/5890451
另一个问题,很明显是 helm 仓库的问题…大概是国外的仓库,国内搞不定,那就换个源好了。
Step 21/42 : RUN curl -sLf ${!HELM_URL_V2} > /usr/bin/rancher-helm && curl -sLf ${!TILLER_URL} > /usr/bin/rancher-tiller && chmod +x /usr/bin/rancher-helm /usr/bin/rancher-tiller && ln -s /usr/bin/rancher-helm /usr/bin/helm && ln -s /usr/bin/rancher-tiller /usr/bin/tiller && helm init -c && helm plugin install https://github.com/rancher/helm-unittest
---> Running in 3a850541282f
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts.storage.googleapis.com/index.yaml : 403 Forbidden
The command '/bin/sh -c curl -sLf ${!HELM_URL_V2} > /usr/bin/rancher-helm && curl -sLf ${!TILLER_URL} > /usr/bin/rancher-tiller && chmod +x /usr/bin/rancher-helm /usr/bin/rancher-tiller && ln -s /usr/bin/rancher-helm /usr/bin/helm && ln -s /usr/bin/rancher-tiller /usr/bin/tiller && helm init -c && helm plugin install https://github.com/rancher/helm-unittest' returned a non-zero code: 1
FATA[0042] exit status 1
make: *** [ci] Error 1
最后从 stack overflow, 找到比较简单的解决方法。
如果这个仓库不行的话,建议使用 aliyun 的仓库
再 make
一下,还是报错。
这个看起来是编译脚本的问题,全局搜一下这个错误信息,可以发现是在 ./scripts/validate
这个脚本内,查了一下,暂时注释掉应该问题不大,因为这里的意思是防止你的 git 仓库有改动没提交就开始编译了,挺麻烦的,但是可以暂时不管。如果平时是修改 rancher 源码再发布的话,走这个流程是相当麻烦的,建议直接 go build
。
如果不想做单测的话,可以注释了这一行。