[sonic-slave]: Refactor Dockerfile. (#502)
Put all packages installation into single apt-get command. This will allow us to do apt-get update only once. Eliminate unnecessary intermediate layers where they are not required. Signed-off-by: marian-pritsak <marianp@mellanox.com>
This commit is contained in:
parent
ebc343120d
commit
31e8b1ec67
@ -2,103 +2,217 @@ FROM debian:jessie
|
|||||||
|
|
||||||
MAINTAINER johnar@microsoft.com
|
MAINTAINER johnar@microsoft.com
|
||||||
|
|
||||||
RUN echo "deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list
|
RUN echo "deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
RUN echo "deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list
|
echo "deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
RUN echo "deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list
|
echo "deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
RUN echo "deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list
|
echo "deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
RUN echo 'deb http://debian-archive.trafficmanager.net/debian jessie-backports main' >> /etc/apt/sources.list
|
echo 'deb http://debian-archive.trafficmanager.net/debian jessie-backports main' >> /etc/apt/sources.list
|
||||||
|
|
||||||
## Make apt-get non-interactive
|
## Make apt-get non-interactive
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get clean && apt-get update && apt-get install -y apt-utils default-jre-headless openssh-server curl wget unzip git build-essential libtool lintian
|
RUN apt-get clean && apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
RUN apt-get update && apt-get install -y sudo dh-make dh-exec kmod libtinyxml2-2 libboost-program-options1.55-dev libtinyxml2-dev python python-pip libncurses5-dev texinfo dh-autoreconf python3-pip
|
default-jre-headless \
|
||||||
RUN apt-get update && apt-get install -y doxygen devscripts git-buildpackage perl-modules libswitch-perl dh-systemd
|
openssh-server \
|
||||||
|
curl \
|
||||||
|
wget \
|
||||||
|
unzip \
|
||||||
|
git \
|
||||||
|
build-essential \
|
||||||
|
libtool \
|
||||||
|
lintian \
|
||||||
|
sudo \
|
||||||
|
dh-make \
|
||||||
|
dh-exec \
|
||||||
|
kmod \
|
||||||
|
libtinyxml2-2 \
|
||||||
|
libboost-program-options1.55-dev \
|
||||||
|
libtinyxml2-dev \
|
||||||
|
python \
|
||||||
|
python-pip \
|
||||||
|
libncurses5-dev \
|
||||||
|
texinfo \
|
||||||
|
dh-autoreconf \
|
||||||
|
python3-pip \
|
||||||
|
doxygen \
|
||||||
|
devscripts \
|
||||||
|
git-buildpackage \
|
||||||
|
perl-modules \
|
||||||
|
libswitch-perl \
|
||||||
|
dh-systemd \
|
||||||
# For quagga build
|
# For quagga build
|
||||||
RUN apt-get update && apt-get install -y libreadline-dev texlive-latex-base texlive-generic-recommended texlive-fonts-recommended libpam0g-dev libpam-dev libcap-dev imagemagick ghostscript groff libpcre3-dev gawk chrpath
|
libreadline-dev \
|
||||||
|
texlive-latex-base \
|
||||||
|
texlive-generic-recommended \
|
||||||
|
texlive-fonts-recommended \
|
||||||
|
libpam0g-dev \
|
||||||
|
libpam-dev \
|
||||||
|
libcap-dev \
|
||||||
|
imagemagick \
|
||||||
|
ghostscript \
|
||||||
|
groff \
|
||||||
|
libpcre3-dev \
|
||||||
|
gawk \
|
||||||
|
chrpath \
|
||||||
# For libnl3 (local) build
|
# For libnl3 (local) build
|
||||||
RUN apt-get install -y cdbs
|
cdbs \
|
||||||
|
|
||||||
# For SAI meta build
|
# For SAI meta build
|
||||||
RUN apt-get update && apt-get install -y libxml-simple-perl graphviz aspell
|
libxml-simple-perl \
|
||||||
|
graphviz \
|
||||||
|
aspell \
|
||||||
# For linux build
|
# For linux build
|
||||||
RUN apt-get update && apt-get install -y bc fakeroot build-essential devscripts quilt stgit
|
bc \
|
||||||
RUN apt-get update && apt-get -y build-dep linux
|
fakeroot \
|
||||||
|
build-essential \
|
||||||
|
devscripts \
|
||||||
|
quilt \
|
||||||
|
stgit \
|
||||||
# For platform-modules build
|
# For platform-modules build
|
||||||
RUN apt-get update && apt-get install -y module-assistant
|
module-assistant \
|
||||||
|
# For thrift build\
|
||||||
# For thrift build
|
gem2deb \
|
||||||
RUN apt-get update && apt-get install -y gem2deb libboost-all-dev libevent-dev libglib2.0-dev libqt4-dev python-all-dev python-twisted php5-dev phpunit libbit-vector-perl openjdk-7-jdk javahelper maven-debian-helper ant libmaven-ant-tasks-java libhttpclient-java libslf4j-java libservlet3.1-java qt5-default
|
libboost-all-dev \
|
||||||
|
libevent-dev \
|
||||||
|
libglib2.0-dev \
|
||||||
|
libqt4-dev \
|
||||||
|
python-all-dev \
|
||||||
|
python-twisted \
|
||||||
|
php5-dev \
|
||||||
|
phpunit \
|
||||||
|
libbit-vector-perl \
|
||||||
|
openjdk-7-jdk \
|
||||||
|
javahelper \
|
||||||
|
maven-debian-helper \
|
||||||
|
ant \
|
||||||
|
libmaven-ant-tasks-java \
|
||||||
|
libhttpclient-java \
|
||||||
|
libslf4j-java \
|
||||||
|
libservlet3.1-java \
|
||||||
|
qt5-default \
|
||||||
# For mellanox sdk build
|
# For mellanox sdk build
|
||||||
RUN apt-get update && apt-get install -y libpcre3 libpcre3-dev byacc flex libglib2.0-dev bison expat libexpat1-dev dpatch libdb-dev iptables-dev swig
|
libpcre3 \
|
||||||
|
libpcre3-dev \
|
||||||
|
byacc \
|
||||||
|
flex \
|
||||||
|
libglib2.0-dev \
|
||||||
|
bison \
|
||||||
|
expat \
|
||||||
|
libexpat1-dev \
|
||||||
|
dpatch \
|
||||||
|
libdb-dev \
|
||||||
|
iptables-dev \
|
||||||
|
swig \
|
||||||
# For mellanox sai build
|
# For mellanox sai build
|
||||||
RUN apt-get update && apt-get install -y libtool-bin libxml2-dev
|
libtool-bin \
|
||||||
|
libxml2-dev \
|
||||||
# For build image
|
# For build image
|
||||||
RUN apt-get update && apt-get install -y cpio squashfs-tools zip
|
cpio \
|
||||||
|
squashfs-tools \
|
||||||
|
zip \
|
||||||
# For broadcom sdk build
|
# For broadcom sdk build
|
||||||
RUN apt-get update && apt-get install -y linux-compiler-gcc-4.8-x86 linux-kbuild-3.16
|
linux-compiler-gcc-4.8-x86 \
|
||||||
|
linux-kbuild-3.16 \
|
||||||
# teamd build
|
# teamd build
|
||||||
RUN apt-get update && apt-get install -y libdaemon-dev libdbus-1-dev libjansson-dev
|
libdaemon-dev \
|
||||||
|
libdbus-1-dev \
|
||||||
|
libjansson-dev \
|
||||||
# For cavium sdk build
|
# For cavium sdk build
|
||||||
RUN apt-get update && apt-get install -y libpcap-dev dnsutils libusb-dev
|
libpcap-dev \
|
||||||
|
dnsutils \
|
||||||
|
libusb-dev \
|
||||||
# For debian image reconfiguration
|
# For debian image reconfiguration
|
||||||
RUN apt-get update && apt-get install -y augeas-tools
|
augeas-tools \
|
||||||
|
|
||||||
# For p4 build
|
# For p4 build
|
||||||
RUN apt-get update && apt-get install -y libyaml-dev libevent-dev libjudy-dev libedit-dev libpcap-dev libnanomsg-dev
|
libyaml-dev \
|
||||||
RUN apt-get update && apt-get install -y python-stdeb
|
libevent-dev \
|
||||||
RUN pip install ctypesgen
|
libjudy-dev \
|
||||||
RUN pip install crc16
|
libedit-dev \
|
||||||
|
libnanomsg-dev \
|
||||||
|
python-stdeb \
|
||||||
# For redis build
|
# For redis build
|
||||||
RUN apt-get update && apt-get install -y libjemalloc-dev
|
libjemalloc-dev \
|
||||||
|
|
||||||
# For mft kernel module build
|
# For mft kernel module build
|
||||||
RUN apt-get update && apt-get install -y dkms
|
dkms \
|
||||||
|
|
||||||
# For python3.5 build
|
# For python3.5 build
|
||||||
RUN apt-get update && apt-get install -y sharutils libncursesw5-dev libbz2-dev liblzma-dev libgdbm-dev tk-dev blt-dev libmpdec-dev libbluetooth-dev locales libsqlite3-dev libgpm2 time net-tools xvfb python-sphinx python3-sphinx
|
sharutils \
|
||||||
|
libncursesw5-dev \
|
||||||
|
libbz2-dev \
|
||||||
|
liblzma-dev \
|
||||||
|
libgdbm-dev \
|
||||||
|
tk-dev \
|
||||||
|
blt-dev \
|
||||||
|
libmpdec-dev \
|
||||||
|
libbluetooth-dev \
|
||||||
|
locales \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libgpm2 \
|
||||||
|
time \
|
||||||
|
net-tools \
|
||||||
|
xvfb \
|
||||||
|
python-sphinx \
|
||||||
|
python3-sphinx \
|
||||||
|
# For Jenkins static analysis, unit testing and code coverage
|
||||||
|
cppcheck \
|
||||||
|
clang \
|
||||||
|
pylint \
|
||||||
|
python-pytest \
|
||||||
|
gcovr \
|
||||||
|
python-pytest=2.6.3* \
|
||||||
|
python-pytest-cov \
|
||||||
|
python-parse \
|
||||||
|
# For snmpd
|
||||||
|
libmysqlclient-dev \
|
||||||
|
libmysqld-dev \
|
||||||
|
libperl-dev \
|
||||||
|
libpci-dev \
|
||||||
|
libpci3 \
|
||||||
|
libsensors4 \
|
||||||
|
libsensors4-dev \
|
||||||
|
libwrap0-dev \
|
||||||
|
# For mpdecimal
|
||||||
|
docutils-common \
|
||||||
|
libjs-sphinxdoc \
|
||||||
|
libjs-underscore \
|
||||||
|
python-docutils \
|
||||||
|
python-jinja2 \
|
||||||
|
python-markupsafe \
|
||||||
|
python-pygments \
|
||||||
|
python-roman \
|
||||||
|
python-sphinx \
|
||||||
|
sphinx-common \
|
||||||
|
python3-sphinx \
|
||||||
|
# For sonic config engine testing
|
||||||
|
python-lxml \
|
||||||
|
python-jinja2 \
|
||||||
|
python-netaddr \
|
||||||
|
python-ipaddr \
|
||||||
|
python-yaml \
|
||||||
|
# For lockfile
|
||||||
|
procmail \
|
||||||
|
# For gtest
|
||||||
|
libgtest-dev \
|
||||||
|
cmake \
|
||||||
|
# For linux build
|
||||||
|
&& apt-get -y build-dep linux \
|
||||||
# For gobgp build
|
# For gobgp build
|
||||||
RUN apt-get -yt jessie-backports install golang-go golang-github-golang-mock-dev
|
&& apt-get -yt jessie-backports install \
|
||||||
|
golang-go \
|
||||||
|
golang-github-golang-mock-dev \
|
||||||
|
# For p4 build
|
||||||
|
&& pip install \
|
||||||
|
ctypesgen \
|
||||||
|
crc16 \
|
||||||
|
# For templating
|
||||||
|
j2cli \
|
||||||
|
# For sonic config engine testing
|
||||||
|
pyangbind
|
||||||
|
|
||||||
|
RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest
|
||||||
|
|
||||||
RUN mkdir /var/run/sshd
|
RUN mkdir /var/run/sshd
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
|
|
||||||
# For gtest
|
|
||||||
RUN apt-get update && apt-get install -y libgtest-dev cmake && cd /usr/src/gtest && cmake . && make -C /usr/src/gtest
|
|
||||||
|
|
||||||
# For Jenkins static analysis, unit testing and code coverage
|
|
||||||
RUN apt-get update && apt-get install -y cppcheck clang pylint python-pytest gcovr python-pytest=2.6.3* python-pytest-cov python-parse
|
|
||||||
|
|
||||||
# For snmpd
|
|
||||||
RUN apt-get update && apt-get install -y libmysqlclient-dev libmysqld-dev libperl-dev libpci-dev libpci3 libsensors4 libsensors4-dev libwrap0-dev
|
|
||||||
|
|
||||||
# For mpdecimal
|
|
||||||
RUN apt-get update && apt-get install -y docutils-common libjs-sphinxdoc libjs-underscore python-docutils python-jinja2 python-markupsafe python-pygments python-roman python-sphinx sphinx-common python3-sphinx
|
|
||||||
|
|
||||||
# For sonic config engine testing
|
|
||||||
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
|
|
||||||
RUN pip install pyangbind
|
|
||||||
|
|
||||||
# For templating
|
|
||||||
RUN pip install j2cli
|
|
||||||
|
|
||||||
# For lockfile
|
|
||||||
RUN apt-get update && apt-get install -y procmail
|
|
||||||
|
|
||||||
# Install depot-tools (for git-retry)
|
# Install depot-tools (for git-retry)
|
||||||
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools
|
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools
|
||||||
ENV PATH /usr/share/depot_tools:$PATH
|
ENV PATH /usr/share/depot_tools:$PATH
|
||||||
|
Reference in New Issue
Block a user