My Life in WordsAll about information and technology
|
在墙内编译DC/OS源码的时候,遇到一个错误,就是由于golang.org不能访问,所以无法下载golang。尝试修改shell的proxy以及golang.org的IP都无法解决。因为浏览器用代理可以直接下载golang,所以手动下载了golang,并通过修改Dockerfile的方法,解决了这个问题。 $cd pkgpanda/docker/dcos-builder
查看Dockerfile --------------- ENV GOLANG_VERSION 1.8.3 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz ---------------- 到此网址手动下载golang1.8.3.linux-amd64.tar.gz。 将此文件拷贝到pkgpanda/docker/dcos-builder目录中。 修改Dockerfile,使其不需要下载golang,而使用从host中拷贝的包 ------------------ 53 ENV GOLANG_VERSION 1.8.3 54 #ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz 55 #ENV GOLANG_DOWNLOAD_SHA256 1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 56 COPY /go$GOLANG_VERSION.linux-amd64.tar.gz /root/golang.tar.gz 57 58 #RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ 59 # && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ 60 RUN tar -C /usr/local -xzf /root/golang.tar.gz \ 61 && rm /root/golang.tar.gz ---------------- 执行$git -C ./ commit -am TMP 否则会出现一下错误: Validation error when fetching sources for package: No local changse are allowed in the git_local_work base repository. Use `git -C ./ status` to see local changes. All local changes must be committed or stashed before the package can be built. One workflow (temporary commit): `git -C ./ commit -am TMP` to commit everything, build the package, `git -C ./ reset --soft HEAD^` to get back to where you were. 此时再进行编译就不会有问题了。
0 Comments
Leave a Reply. |
AuthorThis is a blog that is about my works on Benchmarking Performance, Compiling Optimization, Optimize Compile, Parallel Programming, Virtualization, Container, Docker, Moby, Linuxkit, Open Source and any others. Archives
August 2018
Categories |