github.com/dolfly/pty@v1.2.1/Dockerfile.riscv (about) 1 # NOTE: Using 1.13 as a base to build the RISCV compiler, the resulting version is based on go1.6. 2 FROM golang:1.13 3 4 # Clone and complie a riscv compatible version of the go compiler. 5 RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go 6 # riscvdev branch HEAD as of 2019-06-29. 7 RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf 8 ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH 9 RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash 10 ENV GOROOT=/riscv-go 11 12 # Set the base env. 13 ENV GOOS=linux GOARCH=riscv CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w' 14 15 # Pre compile the stdlib. 16 RUN go build -a std 17 18 # Add the code to the image. 19 WORKDIR pty 20 ADD . . 21 22 # Build the lib. 23 RUN go build