Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ghdl and iverilog in Dockerfile
The dockerfile now uses the latest stable releases from the ghdl and iverilog GitHub releases.
- Loading branch information
Alex McKenna
committed
Jan 13, 2020
1 parent
264e5a4
commit f9211d2
Showing
4 changed files
with
69 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,55 @@ | ||
FROM ubuntu:trusty | ||
FROM ubuntu:bionic | ||
|
||
ARG PARALLEL=-j8 | ||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PATH=/opt/bin:/opt/ghc/bin:/opt/cabal/bin:$PATH | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV PATH /opt/ghc/bin:/opt/cabal/bin:$PATH | ||
|
||
ARG DEPS_GHC="pkg-config libgmp-dev curl" | ||
ARG DEPS_GHC="curl libc6-dev libgmp-dev pkg-config" | ||
ARG DEPS_CABAL="zlib1g-dev" | ||
ARG DEPS_GHDL="clang gcc gnat llvm-dev" | ||
ARG DEPS_IVERILOG="autoconf bison flex gperf" | ||
ARG DEPS_CLASH="libtinfo-dev" | ||
ARG DEPS_CLASH_COSIM="g++-multilib make" | ||
ARG DEPS_IVERILOG_BUILD="autoconf bison flex gperf" | ||
|
||
# enable UTF-8 support | ||
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ARG DEPS_CLASH_COSIM="make" | ||
|
||
# add ghdl & ghc PPA's | ||
COPY ppa-trusted-keys/* /etc/apt/trusted.gpg.d/ | ||
RUN apt-get update && \ | ||
echo "deb http://ppa.launchpad.net/pgavin/ghdl/ubuntu trusty main" > /etc/apt/sources.list.d/pgavin-ghdl-trusty.list && \ | ||
echo "deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main" > /etc/apt/sources.list.d/hvr-ghc-trusty.list && \ | ||
apt-get update | ||
|
||
RUN apt-get -y install git $DEPS_GHC $DEPS_CLASH $DEPS_CLASH_COSIM ghdl | ||
|
||
# needed for iverilog build | ||
RUN apt-get install -y $DEPS_IVERILOG_BUILD | ||
# install iverilog | ||
RUN git clone -b v10-branch --depth 1 https://github.com/steveicarus/iverilog.git iverilog-source && \ | ||
cd iverilog-source && sh autoconf.sh && ./configure && \ | ||
make $PARALLEL && make install && cd .. && rm -r iverilog-source | ||
|
||
# Cleanup | ||
RUN apt-get remove -y $DEPS_IVERILOG_BUILD && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean | ||
|
||
# keep the apt package cache | ||
RUN rm /etc/apt/apt.conf.d/docker-clean | ||
|
||
# Prefetch some packages for speedy installation | ||
ARG PREFETCH="cabal-install-2.4 cabal-install-3.0 ghc-8.2.2 ghc-8.4.4 ghc-8.6.5 ghc-8.8.1" | ||
RUN echo "deb http://ppa.launchpad.net/hvr/ghc/ubuntu bionic main" \ | ||
> /etc/apt/sources.list.d/hvr-ghc.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
$DEPS_GHC $DEPS_CABAL \ | ||
$DEPS_GHDL $DEPS_IVERILOG \ | ||
$DEPS_CLASH $DEPS_CLASH_COSIM \ | ||
ca-certificates \ | ||
git \ | ||
&& curl -L 'https://github.com/ghdl/ghdl/archive/v0.36.tar.gz' \ | ||
| tar -xz \ | ||
&& curl -L 'https://github.com/steveicarus/iverilog/archive/v10_3.tar.gz' \ | ||
| tar -xz | ||
|
||
WORKDIR /ghdl-0.36/build | ||
|
||
RUN ../configure --with-llvm-config --prefix=/opt \ | ||
&& make -j$(nproc) \ | ||
&& make install | ||
|
||
WORKDIR /iverilog-10_3 | ||
|
||
RUN chmod a+x autoconf.sh \ | ||
&& ./autoconf.sh \ | ||
&& ./configure --prefix=/opt \ | ||
&& make -j$(nproc) \ | ||
&& make install | ||
|
||
WORKDIR / | ||
|
||
RUN apt-get remove -y $DEPS_IVERILOG \ | ||
&& rm -Rf ghdl-0.36 iverilog-10_3 \ | ||
&& apt-get autoremove -y --purge \ | ||
&& apt-get clean \ | ||
&& rm /etc/apt/apt.conf.d/docker-clean \ | ||
&& apt-get install -y --download-only \ | ||
cabal-install-2.4 \ | ||
cabal-install-3.0 \ | ||
ghc-8.4.4 \ | ||
ghc-8.6.5 \ | ||
ghc-8.8.1 | ||
|
||
ARG GHC_FETCH_DATE="unknown" | ||
RUN apt-get update && apt-get install -y --download-only $PREFETCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -xeo pipefail | ||
DIR=`dirname "$0"` | ||
now=$(date) | ||
docker build -t clash-ci-image --build-arg "GHC_FETCH_DATE=$now" "$DIR" | ||
echo Press enter to upload image to dockerhub... | ||
read | ||
docker tag clash-ci-image leonschoorl/clash-ci-image:trusty | ||
docker push leonschoorl/clash-ci-image:trusty | ||
|
||
DIR=$(dirname "$0") | ||
now=$(date +%F) | ||
|
||
docker build -t "clashlang/clash-ci:$now" "$DIR" | ||
docker tag "clashlang/clash-ci:$now" "clashlang/clash-ci:latest" | ||
|
||
read -p "Push to DockerHub? (y/N) " push | ||
|
||
if [[ $push =~ ^[Yy]$ ]]; then | ||
docker push "clashlang/clash-ci:$now" | ||
docker push "clashlang/clash-ci:latest" | ||
else | ||
echo "Skipping push to container registry" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters