forked from Mluckydwyer/hw-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-Dev
75 lines (61 loc) · 3 KB
/
Dockerfile-Dev
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
# mluckydwyer/hw-ci Docker Container
FROM mluckydwyer/hw-ci:full as full
LABEL \
org.opencontainers.image.title="Hardware Verification CI Docker container" \
org.opencontainers.image.description="Modelsim, Verilator, GHDL, VUnit, CocoTB, and Pytest for HW Development (+VNC)." \
org.opencontainers.image.authors="Matthew Dwyer <dwyer@iastate.edu>" \
org.opencontainers.image.source="https://github.com/Mluckydwyer/hw-ci"
ENV \
container docker \
# DISPLAY=host.docker.internal:0.0 \
LIBGL_ALWAYS_INDRIECT=1
# General Development Tools
FROM full as dev-tools
# RUN yum groupinstall "Development tools"
RUN yum -y install centos-release-scl centos-release-scl-rh bash
RUN yum -y install devtoolset-10 llvm-toolset-11.0
# RUN scl enable devtoolset-10 'sh' \
# scl enable llvm-toolset-11.0 'sh' \
# scl enable devtoolset-10 'bash' \
# scl enable llvm-toolset-11.0 'bash'
# Quality of Life Additions
FROM dev-tools as qol
RUN yum -y install bash wget htop sudo vim nano cmake openssl teroshdl firefox dos2unix gtkwave \
&& pip3 install matplotlib remote_pdb debugpy teroshdl yowasp-yosys vsg
# VSCode Remote Env
FROM qol as vscode
EXPOSE 8080
RUN curl -sSL https://code-server.dev/install.sh | sh \
&& mkdir -p ~/.config/code-server \
&& touch ~/.config/code-server/config.yaml \
&& sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
# RUN echo "(/usr/bin/start-code-server.sh &> /tmp/code-server.log)" >> ~/.bashrc
# Command Line ZSH tools
# RUN curl -sSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
# RUN echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
# RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# RUN echo 'source ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting' >>! ~/.zshrc
# RUN sed -i 's/_THEME=\"robbyrussel\"/_THEME=\"linuxonly\"/g' ~/.zshrc
# RUN chsh -s /bin/zsh
# VNC Server for GUI applications
FROM qol as vnc
ENV WINDOW_MANAGER="openbox"
EXPOSE 5900 6080
RUN yum -y install xorg-x11-server-Xvfb x11vnc xterm openbox \
&& pip3 install numpy \
&& sed -ri "s/<number>4<\/number>/<number>1<\/number>/" /etc/xdg/openbox/rc.xml \
&& git clone --depth 1 https://github.com/novnc/noVNC.git /opt/novnc \
&& git clone --depth 1 https://github.com/novnc/websockify /opt/novnc/utils/websockify \
&& echo "export DISPLAY=:0" >> ~/.bashrc \
&& echo "[ ! -e /tmp/.X0-lock ] && (/usr/bin/start-vnc-session.sh &> /tmp/display-\${DISPLAY}.log)" >> ~/.bashrc
COPY resources/novnc-index.html /opt/novnc/index.html
COPY resources/start-vnc-session.sh /usr/bin/
RUN chmod +x /usr/bin/start-vnc-session.sh
FROM vnc as final
ENV PATH=/workspaces/tools:$PATH
WORKDIR /workspaces/
COPY ./resources /workspaces/tools
RUN chmod +x /workspaces/tools/*.sh \
&& chmod +rw /root/ -R
ENTRYPOINT /usr/bin/startup.sh