Skip to content

Fixed root Dockerfile for building vtr container #1970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 25 additions & 84 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,88 +1,29 @@
FROM ubuntu:trusty as builder

RUN apt-get update
RUN apt-get install -y \
software-properties-common

# add auto gpg key other lauchpad ppa
RUN add-apt-repository ppa:nilarimogard/webupd8
RUN apt-get update && apt-get install -y \
launchpad-getkeys

# add llvm PPA
RUN printf "\n\
deb http://ppa.launchpad.net/george-edison55/precise-backports/ubuntu precise main \n\
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main \n\
deb https://apt.llvm.org/precise llvm-toolchain-precise-3.6 main \n\
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-6.0 main \n\
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-7 main \n\
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-8 main \n\
" >> /etc/apt/sources.list

# grab llvm keys
RUN launchpad-getkeys

RUN apt-get update
RUN apt-get install -y \
ninja \
libssl-dev \
autoconf \
automake \
bash \
bison \
binutils \
binutils-gold \
build-essential \
ctags \
curl \
doxygen \
flex \
fontconfig \
gdb \
git \
gperf \
libcairo2-dev \
libgtk-3-dev \
libevent-dev \
libfontconfig1-dev \
liblist-moreutils-perl \
libncurses5-dev \
libx11-dev \
libxft-dev \
libxml++2.6-dev \
perl \
python \
python-lxml \
texinfo \
time \
valgrind \
zip \
qt5-default \
clang-format-7 \
g++-7 \
gcc-7 \
g++-8 \
gcc-8 \
g++-9 \
gcc-9 \
g++-10 \
gcc-10 \
g++-11 \
gcc-11 \
clang-6.0 \
clang-7 \
clang-10

# install CMake
WORKDIR /tmp
ENV CMAKE=cmake-3.17.0
RUN curl -s https://cmake.org/files/v3.17/${CMAKE}.tar.gz | tar xvzf -
RUN cd ${CMAKE} && ./configure && make && make install

FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
# set out workspace
ENV WORKSPACE=/workspace
RUN mkdir -p ${WORKSPACE}
VOLUME ${WORKSPACE}
WORKDIR ${WORKSPACE}

CMD [ "/bin/bash" ]
COPY . ${WORKSPACE}
# Install and cleanup is done in one command to minimize the build cache size
RUN apt-get update -qq \
# Extract package names from install_apt_packages.sh
&& sed '/sudo/d' install_apt_packages.sh | sed '/#/d' | sed 's/ \\//g' | sed '/^$/d' | sed '/^[[:space:]]*$/d' \
# Install packages
| xargs apt-get -y install --no-install-recommends \
# Additional packages not listed in install_apt_packages.sh
&& apt-get -y install --no-install-recommends \
wget \
ninja-build \
libeigen3-dev \
libtbb-dev \
python3-pip \
# Install python packages
&& pip install -r requirements.txt \
# Cleanup
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
# Build VTR
RUN make && make install
# Container's default launch command
SHELL ["/bin/bash", "-c"]