-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (49 loc) · 1.88 KB
/
Dockerfile
File metadata and controls
60 lines (49 loc) · 1.88 KB
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
FROM python:3.11.5-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
git curl wget \
libelf-dev srecord \
autoconf automake autotools-dev \
libmpc-dev libmpfr-dev libgmp-dev \
gawk bison flex texinfo patchutils libexpat1-dev \
libfl2 libfl-dev \
help2man perl \
liblzma-dev libunwind-dev libgoogle-perftools-dev numactl \
ccache \
&& rm -rf /var/lib/apt/lists/*
COPY ibex-soc/python-requirements.txt /tmp/python-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/python-requirements.txt \
&& rm -rf /tmp/python-requirements.txt /tmp/vendor
ARG VERILATOR_VERSION=v5.024
RUN git clone https://github.com/verilator/verilator.git \
&& cd verilator && git checkout ${VERILATOR_VERSION} \
&& autoconf && ./configure \
&& make -j"$(nproc)" && make install \
&& cd .. && rm -rf verilator
WORKDIR /tmp/pybuild
COPY pyproject.toml .
COPY LICENSE .
COPY README.md .
COPY deepsocflow ./deepsocflow
RUN python3 -m pip install --no-cache-dir .
ARG RISCV_TOOLCHAIN_VERSION=20240206-1
RUN wget https://raw.githubusercontent.com/lowRISC/opentitan/master/util/get-toolchain.py -O /tmp/get-toolchain.py \
&& python3 /tmp/get-toolchain.py \
--install-dir /opt/lowrisc-toolchain \
--release-version ${RISCV_TOOLCHAIN_VERSION} \
--update \
&& rm /tmp/get-toolchain.py
ENV RISCV_TOOLCHAIN=/opt/lowrisc-toolchain
ENV RISCV_GCC=${RISCV_TOOLCHAIN}/bin/riscv32-unknown-elf-gcc
ENV RISCV_OBJCOPY=${RISCV_TOOLCHAIN}/bin/riscv32-unknown-elf-objcopy
ENV PATH=${RISCV_TOOLCHAIN}/bin:${PATH}
# Create non-root user to match host UID/GID
ARG USERNAME=usr
ARG UID=1000
ARG GID=1000
RUN groupadd -g ${GID} ${USERNAME} \
&& useradd -m -u ${UID} -g ${GID} ${USERNAME}
USER ${USERNAME}
WORKDIR /work
RUN echo 'export PS1="\[\e[0;33m\][\u@\h \W]\$ \[\e[m\] "' >> /home/${USERNAME}/.bashrc