Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update go version in Dockerfile and fix bugs #568

Merged
merged 2 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions scripts/docker/kclvm-builder-centos8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,31 @@ RUN yum -y install llvm-devel
RUN yum -y install libffi-devel
RUN ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so

# Go 1.6
RUN yum -y install golang
RUN go version
# golang 1.19+
RUN mkdir -p /root/download && cd /root/download \
&& wget https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz \
&& tar -zxvf go1.20.5.linux-amd64.tar.gz \
&& mv ./go /usr/local/go1.20.5
RUN ln -sf /usr/local/go1.20.5/bin/go /usr/bin/go
RUN rm -rf /root/download

# /usr/lib64/python3.9
RUN yum -y install python39-devel
RUN python3 -m pip install pytest
ENV GOPATH=/go
ENV GOLANG_VERSION=1.20.5

# golang apps
RUN go get golang.org/x/lint/golint
RUN go get golang.org/x/tools/cmd/goimports
#RUN go get honnef.co/go/tools/cmd/...
RUN go install golang.org/x/lint/golint@latest
RUN go install golang.org/x/tools/cmd/goimports@latest
# RUN go install honnef.co/go/tools/cmd/...@latest

RUN go get github.com/t-yuki/gocover-cobertura
RUN go get github.com/jstemmer/go-junit-report
RUN go install github.com/t-yuki/gocover-cobertura@latest
RUN go install github.com/jstemmer/go-junit-report@latest

RUN rm -rf /go/pkg/mod
RUN rm -rf /go/pkg/sumdb

# /usr/lib64/python3.9
RUN yum -y install python39-devel
RUN python3 -m pip install pytest

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/kclvm-builder-centos8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ publish-builder:
@echo "push ${BUILDER_IMAGE} ok"

sh-in-builder:
${RUN_IN_DOCKER} -v ${PWD}/../..:/root/kclvm -w /root ${BUILDER_IMAGE} bash
${RUN_IN_DOCKER} -v ${PWD}/../../..:/root/kclvm -w /root ${BUILDER_IMAGE} bash

clean:
22 changes: 11 additions & 11 deletions scripts/docker/kclvm-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ RUN apt-get install -y clang-12 lld-12
RUN ln -sf /usr/bin/clang-12 /usr/bin/clang
RUN ln -sf /usr/bin/wasm-ld-12 /usr/bin/wasm-ld

# golang 1.17+
# golang 1.19+
RUN mkdir -p /root/download && cd /root/download \
&& wget https://dl.google.com/go/go1.17.3.linux-amd64.tar.gz \
&& tar -zxvf go1.17.3.linux-amd64.tar.gz \
&& mv ./go /usr/local/go1.17.3
RUN ln -sf /usr/local/go1.17.3/bin/go /usr/bin/go
&& wget https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz \
&& tar -zxvf go1.20.5.linux-amd64.tar.gz \
&& mv ./go /usr/local/go1.20.5
RUN ln -sf /usr/local/go1.20.5/bin/go /usr/bin/go
RUN rm -rf /root/download

ENV GOPATH=/go
ENV GOLANG_VERSION=1.17.3
ENV GOLANG_VERSION=1.20.5

RUN go get golang.org/x/lint/golint
RUN go get golang.org/x/tools/cmd/goimports
RUN go get honnef.co/go/tools/cmd/...
RUN go install golang.org/x/lint/golint@latest
RUN go install golang.org/x/tools/cmd/goimports@latest
RUN go install honnef.co/go/tools/cmd/...@latest

RUN go get github.com/t-yuki/gocover-cobertura
RUN go get github.com/jstemmer/go-junit-report
RUN go install github.com/t-yuki/gocover-cobertura@latest
RUN go install github.com/jstemmer/go-junit-report@latest

RUN rm -rf /go/pkg/mod
RUN rm -rf /go/pkg/sumdb
Expand Down