Skip to content

Commit cfff483

Browse files
committed
first release
0 parents  commit cfff483

File tree

5 files changed

+157
-0
lines changed

5 files changed

+157
-0
lines changed

Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM ubuntu16
2+
LABEL maintainer "ittou <VYG07066@gmail.com>"
3+
ENV DEBIAN_FRONTEND noninteractive
4+
ENV ALTERA_VER="19.1"
5+
ENV INTELFPGA_TOOLDIR="/opt/Intel/intelFPGA_lite/${ALTERA_VER}"
6+
ENV MODELSIM_DIR="${INTELFPGA_TOOLDIR}/modelsim_ase"
7+
ENV QUARTUS_ROOTDIR="${INTELFPGA_TOOLDIR}/quartus"
8+
ENV HLS_ROOTDIR="${INTELFPGA_TOOLDIR}/hls"
9+
ENV QSYS_ROOTDIR="${QUARTUS_ROOTDIR}/sopc_builder/bin"
10+
ENV QUARTUS_ROOTDIR_OVERRIDE=${QUARTUS_ROOTDIR}
11+
ENV CPLUS_INCLUDE_PATH=/usr/include/c++/4.4.7:/usr/include/c++/4.4.7/x86_64-linux-gnu
12+
ENV PATH=/opt/Intel/intelFPGA_lite/$ALTERA_VER/quartus/bin:/opt/Intel/intelFPGA_lite/$ALTERA_VER/qsys/bin:/opt/Intel/intelFPGA_lite/$ALTERA_VER/quartus/sopc_builder/bin:/opt/Intel/intelFPGA_lite/$ALTERA_VER/modelsim_ase/linux:/opt/Intel/intelFPGA_lite/$ALTERA_VER/hls/bin:$PATH
13+
ARG URIS=smb://192.168.103.223/Share/Quartus19.1/
14+
ARG QUARTUS=QuartusLiteSetup-19.1.0.670-linux.run
15+
ARG MAX10=max10-19.1.0.670.qdz
16+
ARG MODELSIM=ModelSimSetup-19.1.0.670-linux.run
17+
ARG HLS=HLSProSetup-19.1.0.670-linux.run
18+
RUN mkdir /quartus-installer && \
19+
curl -u guest ${URIS}${QUARTUS} -o /quartus-installer/${QUARTUS} && \
20+
curl -u guest ${URIS}${MAX10} -o /quartus-installer/${MAX10} && \
21+
curl -u guest ${URIS}${MODELSIM} -o /quartus-installer/${MODELSIM} && \
22+
curl -u guest ${URIS}${HLS} -o /quartus-installer/${HLS} && \
23+
apt-get update && \
24+
apt-get -y -qq install sudo && \
25+
apt-get -y -qq install locales && locale-gen en_US.UTF-8 && \
26+
apt-get -y -qq install software-properties-common \
27+
libglib2.0-0:amd64 \
28+
libfreetype6:amd64 \
29+
libsm6:amd64 \
30+
libxrender1:amd64 \
31+
libfontconfig1:amd64 \
32+
libxext6:amd64 \
33+
libpng12-0:amd64 \
34+
xterm:amd64 \
35+
gcc \
36+
g++ && \
37+
dpkg --add-architecture i386 && \
38+
apt-get update && \
39+
apt-get -y -qq install libc6:i386 \
40+
libncurses5:i386 \
41+
libstdc++6:i386 \
42+
libxft2:i386 \
43+
libxext6:i386 && \
44+
add-apt-repository "deb http://jp.archive.ubuntu.com/ubuntu/ trusty main universe" && \
45+
add-apt-repository "deb http://jp.archive.ubuntu.com/ubuntu/ trusty-updates main universe" && \
46+
apt-get update && \
47+
apt-get -y -qq install g++-4.4 \
48+
g++-4.4-multilib && \
49+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10 --slave /usr/bin/g++ g++ /usr/bin/g++-5 && \
50+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 5 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4 && \
51+
update-alternatives --set gcc /usr/bin/gcc-4.4 && \
52+
apt-get autoclean && \
53+
apt-get autoremove && \
54+
chmod 755 /quartus-installer/${QUARTUS} && \
55+
chmod 755 /quartus-installer/${MODELSIM} && \
56+
chmod 755 /quartus-installer/${HLS} && \
57+
rm -rf /var/lib/apt/lists/* && \
58+
/quartus-installer/${QUARTUS} --mode unattended --unattendedmodeui none --installdir ${INTELFPGA_TOOLDIR} --accept_eula 1 && \
59+
/quartus-installer/${MODELSIM} --mode unattended --unattendedmodeui none --installdir ${INTELFPGA_TOOLDIR} --accept_eula 1 && \
60+
/quartus-installer/${HLS} --mode unattended --unattendedmodeui none --installdir ${INTELFPGA_TOOLDIR} --accept_eula 1 && \
61+
sudo rm -rf /quartus-installer/ && \
62+
sudo ln -s ${MODELSIM_DIR}/linux ${MODELSIM_DIR}/linux_rh60 && \
63+
sudo mkdir ${MODELSIM_DIR}/Unused && \
64+
sudo mv ${MODELSIM_DIR}/gcc-4.* ${MODELSIM_DIR}/Unused
65+
66+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
67+
RUN chmod +x /usr/local/bin/entrypoint.sh
68+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
69+
CMD ["/bin/bash", "-c", "source ${INTELFPGA_TOOLDIR}/hls/init_hls.sh;/bin/bash -l"]
70+

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Quartus Prime Lite Edition docker image
2+
====
3+
4+
#Overview
5+
6+
## Description
7+
Quartus Prime enviroment on Ubuntu.
8+
9+
## Requirement
10+
* Quartus Prime Lite のフルインストーラー、及びアップデータをネットワーク参照できる場所に置く。
11+
* URIは環境に合わせてDockerfileを変更する(環境変数URIS)。
12+
* Docker上のユーザ/グループは、ホストの1000:1000と共通とする。
13+
* HOMEをホストの$HOME/docker/userhomeに固定としてmountする。
14+
* $HOME/docker/userhome/.bashrcに下記を設定しておく。
15+
```
16+
alias quartus='env SWT_GTK3=0 quartus'
17+
```
18+
* ホスト上で予めUSBブラスターを認識させておく。
19+
```
20+
$cat /etc/udev/rules.d/99-alterablaster.rules
21+
# Intel/Altera USB-Blaster
22+
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", SYMLINK+="usbblaster/%k"
23+
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666", SYMLINK+="usbblaster/%k"
24+
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666", SYMLINK+="usbblaster/%k"
25+
# Intel/Altera USB-Blaster II
26+
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666", SYMLINK+="usbblaster2/%k"
27+
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666", SYMLINK+="usbblaster2/%k"
28+
```
29+
* 公式とは別にカスタムのUbuntu16イメージをベースにしているので、別途準備する。
30+
https://github.com/ittouogami/ubuntu16_docker
31+
32+
## Install
33+
34+
```
35+
$./build.sh
36+
$./boot.sh
37+
```
38+
39+
## Author
40+
41+
[ittou](https://github.com/ittouogami)
42+
43+

boot.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
docker run -it --rm \
2+
--net host \
3+
-e LOCAL_UID=$(id -u $USER) \
4+
-e LOCAL_GID=$(id -g $USER) \
5+
-e USER=$USER \
6+
-e UART_GROUP_ID=20 \
7+
-e DISPLAY=$DISPLAY \
8+
-e "QT_X11_NO_MITSHM=1" \
9+
-v /tmp/.X11-unix:/tmp/.X11-unix \
10+
-v $HOME/.Xauthority:$HOME/.Xauthority \
11+
-v $HOME/docker/userhome:$HOME \
12+
--privileged \
13+
-v /dev/bus/usb:/dev/bus/usb \
14+
-v /sys:/sys:ro \
15+
-w $HOME \
16+
quartus19.1

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker image build --rm --no-cache -t quartus19.1 .

entrypoint.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
USER=${USER:-root}
3+
USER_ID=${LOCAL_UID:-1000}
4+
GROUP_ID=${LOCAL_GID:-1000}
5+
echo "Starting with UID : $USER_ID, GID: $GROUP_ID,USER: $USER"
6+
7+
UART_GROUP_ID=${UART_GROUP_ID:-20}
8+
if ! grep -q "x:${UART_GROUP_ID}:" /etc/group; then
9+
groupadd -g "$UART_GROUP_ID" uart
10+
fi
11+
UART_GROUP=$(grep -Po "^\\w+(?=:x:${UART_GROUP_ID}:)" /etc/group)
12+
13+
if [[ -n "$USER_ID" ]]; then
14+
export HOME=/home/$USER
15+
useradd -s /bin/bash -u $USER_ID -o -d $HOME $USER
16+
usermod -aG sudo $USER
17+
usermod -aG $UART_GROUP $USER
18+
echo root:root |chpasswd
19+
echo ${USER}:${USER} |chpasswd
20+
chown $USER_ID:$GROUP_ID -R $HOME
21+
#chown $USER_ID:$GROUP_ID -R /opt
22+
chown $USER $(tty)
23+
exec /usr/sbin/gosu "$USER" "$@"
24+
else
25+
exec "$@"
26+
fi
27+

0 commit comments

Comments
 (0)