-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
113 lines (94 loc) · 2.97 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Use an official Ubuntu 22.04 as a parent image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install required packages and tools
RUN apt-get update && apt-get install -y \
openjdk-8-jdk \
wget \
build-essential \
python3 \
python3-pip \
verilator \
libevent-dev \
libjson-c-dev \
device-tree-compiler \
python3-setuptools \
python3-requests \
python3-pexpect \
python3-colorama \
python3-serial \
python3-packaging \
python3-yaml \
ninja-build \
curl \
apt-transport-https \
gnupg \
cmake \
git # Install Git
# Install Meson
RUN pip3 install meson
# Install Git, (n)Migen / LiteX / Cores
WORKDIR /root
RUN wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
RUN python3 litex_setup.py init install --user
# Install RISC-V GCC
WORKDIR /root
RUN wget https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
RUN tar -xf riscv64-*.tar.gz
RUN mkdir /usr/local/riscv
RUN cp -r riscv64-*/* /usr/local/riscv
# Add Gowin Tools directory to PATH
ENV PATH="/IDE/bin:${PATH}"
# Set PATH for RISC-V GCC
ENV PATH="/usr/local/riscv/bin:${PATH}"
# Import the GPG key for Scala SBT repository
RUN apt-get update && apt-get install -y gnupg2
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 99E82A75642AC823
RUN gpg --export --armor 99E82A75642AC823 | apt-key add -
# Install sbt
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
RUN apt-get update && apt-get install -y sbt
# Copy the IDE folder into the Docker image
RUN mkdir /IDE
COPY ./IDE /IDE
# Build and install openFPGALoader
WORKDIR /root
# Add this line to install SWIG and other required dependencies
RUN apt-get update && apt-get install -y \
git \
gzip \
libftdi1-2 \
libftdi1-dev \
libhidapi-hidraw0 \
libhidapi-dev \
libudev-dev \
zlib1g-dev \
cmake \
pkg-config \
make \
g++ \
swig \
libreadline-dev
# Install the openFPGALoader form repository
RUN git clone https://github.com/trabucayre/openFPGALoader && \
cd openFPGALoader && \
mkdir build && cd build && cmake ..
WORKDIR /root/openFPGALoader/build
RUN make all
RUN cp openFPGALoader /usr/local/bin
WORKDIR /root
WORKDIR /home/
# Just clone the linux-on-litex repo on /home
RUN git clone https://github.com/litex-hub/linux-on-litex-vexriscv.git
ENV JAVA_OPTS="-Xmx4g -Xms2g -XX:MaxMetaspaceSize=512m"
# Add the USB tools to the docker
RUN apt-get update && apt-get install -y usbutils vim
# Fix the python link
RUN ln -s /usr/bin/python3 /usr/bin/python
# Fix the issue over video core
WORKDIR /root/litex/litex
RUN git checkout cd8218779e0eb05c73785cd6b8866dc3215c1710
# Let the /home/linux-on-litex-vexriscv be the default when login to the docker
WORKDIR /home/linux-on-litex-vexriscv
# Define the entry point or any other custom instructions