Dockerfile.riscv 735 B

1234567891011121314151617181920212223
  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. # Clone and complie a riscv compatible version of the go compiler.
  4. RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go
  5. # riscvdev branch HEAD as of 2019-06-29.
  6. RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf
  7. ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH
  8. RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash
  9. ENV GOROOT=/riscv-go
  10. # Set the base env.
  11. ENV GOOS=linux GOARCH=riscv CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'
  12. # Pre compile the stdlib.
  13. RUN go build -a std
  14. # Add the code to the image.
  15. WORKDIR pty
  16. ADD . .
  17. # Build the lib.
  18. RUN go build