├── quartus ├── files ├── usr │ └── local │ │ └── bin │ │ └── quartus_wrapper └── root │ ├── .profile │ ├── .profile.addons │ ├── setup.2 │ └── setup ├── README.md ├── LICENSE ├── .gitlab-ci.yml └── Dockerfile /quartus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker run --rm -it -e "JTAG_SERVER=$JTAG_SERVER" -e "JTAG_PASSWD=$JTAG_PASSWD" -v $(pwd):/build chriz2600/quartus-lite:latest /usr/local/bin/quartus_wrapper "$@" 4 | -------------------------------------------------------------------------------- /files/usr/local/bin/quartus_wrapper: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | CMD="$1" 4 | shift 5 | 6 | test -d /build && cd /build 7 | 8 | # set up remote 9 | if [ -n "$JTAG_SERVER" -a -n "$JTAG_PASSWD" ] ; then 10 | jtagconfig --addserver "$JTAG_SERVER" "$JTAG_PASSWD" 11 | fi 12 | 13 | $CMD "$@" 14 | -------------------------------------------------------------------------------- /files/root/.profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by Bourne-compatible login shells. 2 | 3 | if [ "$BASH" ]; then 4 | if [ -f ~/.bashrc ]; then 5 | . ~/.bashrc 6 | fi 7 | fi 8 | 9 | mesg n 10 | export LC_ALL="en_US.UTF-8" 11 | export LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.4 12 | alias l='ls -alF' 13 | alias ll='ls -alF' 14 | alias ..='cd ..' 15 | 16 | if [ -f /root/.profile.addons ]; then 17 | source /root/.profile.addons 18 | fi 19 | -------------------------------------------------------------------------------- /files/root/.profile.addons: -------------------------------------------------------------------------------- 1 | export Q_INST_DIR=/opt/intelFPGA_lite/20.1 2 | 3 | export QUARTUS_ROOTDIR=${Q_INST_DIR}/quartus 4 | export SOPC_KIT_NIOS2=${Q_INST_DIR}/nios2eds 5 | 6 | export PATH=${Q_INST_DIR}/quartus/sopc_builder/bin/:$PATH 7 | export PATH=${Q_INST_DIR}/quartus/bin/:$PATH 8 | export PATH=${Q_INST_DIR}/nios2eds/:$PATH 9 | export PATH=${Q_INST_DIR}/nios2eds/bin/:$PATH 10 | export PATH=${Q_INST_DIR}/nios2eds/sdk2/bin/:$PATH 11 | export PATH=${Q_INST_DIR}/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/:$PATH 12 | export PATH=${Q_INST_DIR}/quartus/linux64/gnu/:$PATH 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # quartus-lite 2 | 3 | Quartus Lite docker. 4 | 5 | For Mac OS X users, I included a `quartus` shell script, which allows execution of e.g. `quartus_sh` inside the docker container. The current working directory is mounted to `/build`. 6 | 7 | Example: 8 | ``` 9 | quartus quartus_sh --flow compile my.qpf 10 | ``` 11 | `quartus_sh` command is executed in the current working directory. 12 | Just copy `quartus_sh` to a directory in your `PATH`. 13 | 14 | Environment variables: 15 | - `JTAG_SERVER`: allows setting a server for remote programming 16 | - `JTAG_PASSWD`: allows setting a server password for remote programming 17 | -------------------------------------------------------------------------------- /files/root/setup.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | set timeout -1 4 | 5 | set version [lindex $argv 0] 6 | if {$version == ""} { 7 | set version "18.1" 8 | } 9 | 10 | spawn /root/quartus/QuartusSetup-18.1.1.646-linux.run 11 | 12 | expect "Press \\\[Enter\\\] to continue:" { send "\r" } 13 | expect "Press \\\[Enter\\\] to continue:" { send "\r" } 14 | 15 | puts "----------------------------------" 16 | 17 | set count 45; 18 | while {$count > 0 } { 19 | expect "Press \\\[Enter\\\] to continue:" { send "\r" } 20 | puts "\n\ncount : $count\n\n"; 21 | set count [expr $count-1]; 22 | } 23 | 24 | expect "Do you accept this license? \\\[y/n\\\]" { send "y\r" } 25 | expect "Please choose an option \\\[1\\\]" { send "1\r" } 26 | expect "Specify installation to update \\\[\\\]:" { send "/opt/intelFPGA_lite/$version\r" } 27 | expect "Allow patches to be uninstalled \\\[Y/n\\\]:" { send "n\r" } 28 | expect eof 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Christof Harnischmacher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | DOCKER_DRIVER: overlay2 3 | DOCKER_TLS_CERTDIR: "/certs" 4 | 5 | docker: 6 | image: docker 7 | stage: deploy 8 | services: 9 | - name: docker:dind 10 | script: 11 | - | 12 | echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY 13 | echo $DOCKER_HUB_PASSWORD | docker login -u $DOCKER_HUB_USERNAME --password-stdin 14 | 15 | docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --build-arg VERSION="=$CI_COMMIT_REF_NAME" --build-arg DOCKER_TAG="$CI_COMMIT_REF_NAME" . 16 | 17 | docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest 18 | docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME 19 | docker tag $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:latest 20 | 21 | docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME 22 | docker push $CI_REGISTRY_IMAGE:latest 23 | docker push $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME 24 | docker push $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:latest 25 | only: 26 | - tags 27 | tags: 28 | - docker-privileged 29 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie-backports 2 | 3 | # basic packages 4 | RUN echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list && \ 5 | echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list && \ 6 | sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list && \ 7 | echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/100disablechecks && \ 8 | apt-get update && apt-get -y install expect locales wget libtcmalloc-minimal4 libglib2.0-0 && \ 9 | echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ 10 | locale-gen en_US.UTF-8 && \ 11 | /usr/sbin/update-locale LANG=en_US.UTF-8 12 | 13 | # adding scripts 14 | ADD files/ / 15 | 16 | # install quartus prime 17 | # 19.1.0 http://download.altera.com/akdlm/software/acdsinst/19.1std/670/ib_tar/Quartus-lite-19.1.0.670-linux.tar 18 | RUN mkdir -p /root/quartus && \ 19 | cd /root/quartus && \ 20 | wget -q http://download.altera.com/akdlm/software/acdsinst/20.1std/711/ib_tar/Quartus-lite-20.1.0.711-linux.tar && \ 21 | tar xvf Quartus-lite-20.1.0.711-linux.tar && \ 22 | /root/setup 20.1 && rm -rf /root/quartus && rm -rf /root/setup* 23 | -------------------------------------------------------------------------------- /files/root/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | set timeout -1 4 | 5 | set version [lindex $argv 0] 6 | if {$version == ""} { 7 | set version "18.1" 8 | } 9 | 10 | spawn /root/quartus/setup.sh 11 | 12 | expect { 13 | "Press \\\[Enter\\\] to continue:" { send "\r"; exp_continue } 14 | "Do you accept this license? \\\[y/n\\\]" { send "y\r"; exp_continue } 15 | "Installation directory \\\[/root/intelFPGA_lite/$version\\\]:" { send "/opt/intelFPGA_lite/$version\r"; exp_continue } 16 | "Quartus Prime Lite Edition (Free) \\\[Y/n\\\] :" { send "y\r"; exp_continue } 17 | "Quartus Prime Lite Edition (Free) - Quartus Prime Help" { send "n\r"; exp_continue } 18 | "Quartus Prime Lite Edition (Free) - Devices" { send "y\r"; exp_continue } 19 | "ModelSim - Intel FPGA Starter Edition (Free)" { send "n\r"; exp_continue } 20 | "ModelSim - Intel FPGA Edition" { send "n\r"; exp_continue } 21 | "Is the selection above correct? \\\[Y/n\\\]:" { send "y\r"; exp_continue } 22 | "Create shortcuts on Desktop \\\[Y/n\\\]:" { send "n\r"; exp_continue } 23 | "Launch Quartus Prime Lite Edition \\\[Y/n\\\]:" { send "n\r"; exp_continue } 24 | "Provide your feedback at" { send "n\r"; exp_continue } 25 | eof { } 26 | } 27 | 28 | puts "----------------------------------" 29 | --------------------------------------------------------------------------------