-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (51 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (51 loc) · 1.65 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
61
62
# Modified from
# https://raw.githubusercontent.com/freechipsproject/chisel-bootcamp/master/Dockerfile
# First stage : setup the system and environment
FROM ubuntu:22.04
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates-java \
curl \
default-jdk-headless \
gnupg \
python3-distutils \
build-essential \
g++ \
make cmake \
graphviz \
verilator \
&& \
rm -rf /var/lib/apt/lists/*
ENV SCALA_VERSION=2.12.12
ENV ALMOND_VERSION=0.10.9
RUN useradd -ms /bin/bash tutorial
USER tutorial
ENV USER=tutorial
ENV HOME=/home/$USER
WORKDIR $HOME
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
ENV PATH=$HOME/.local/bin:$PATH
RUN python3 get-pip.py
RUN pip3 install notebook
RUN rm get-pip.py
RUN curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > cs
RUN chmod +x cs && ./cs setup -y
ENV PATH=$HOME/.local/share/coursier/bin:$PATH
RUN ./cs launch --fork almond:$ALMOND_VERSION --scala $SCALA_VERSION -- --install
RUN rm cs
USER root
ADD . /pillars/
RUN chown -R tutorial:tutorial /pillars
USER tutorial
WORKDIR /pillars
ENV JUPYTER_CONFIG_DIR=$HOME/jupyter/config
ENV JUPITER_DATA_DIR=$HOME/jupyter/data
RUN mkdir -p $JUPYTER_CONFIG_DIR/custom
RUN cp tutorial/custom.js $JUPYTER_CONFIG_DIR/custom/
# Execute a notebook to ensure Chisel is downloaded into the image for offline work
RUN make build
RUN jupyter nbconvert --to notebook --output=/tmp/3-desc-arch --execute tutorial/3-desc-arch.ipynb
WORKDIR /pillars/tutorial
EXPOSE 8888
CMD jupyter notebook --no-browser --ip 0.0.0.0 --port 8888