提交 e1eba35e 编写于 作者: S storypku 提交者: Xiangquan Xiao

Docker::Installers: added CLEAN_DEPS and default to "yes"

To control removal of build-deps when running docker build
上级 fcac289b
......@@ -307,6 +307,7 @@ function docker_build_run() {
--build-arg CUDA_LITE="${CUDA_LITE}" \
--build-arg CUDNN_VERSION="${CUDNN_VERSION}" \
--build-arg TENSORRT_VERSION="${TENSORRT_VERSION}" \
--build-arg CLEAN_DEPS="yes" \
-f "${DOCKERFILE}" \
"${context}"
set +x
......
......@@ -3,6 +3,7 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG GEOLOC
ARG CLEAN_DEPS
ARG INSTALL_MODE
LABEL version="1.2"
......
......@@ -3,6 +3,7 @@ FROM ${BASE_IMAGE}
ARG APOLLO_DIST
ARG GEOLOC
ARG CLEAN_DEPS
ARG INSTALL_MODE
LABEL version="1.2"
......
......@@ -2,6 +2,7 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG GEOLOC
ARG CLEAN_DEPS
ARG INSTALL_MODE
WORKDIR /apollo
......@@ -16,7 +17,6 @@ RUN bash /tmp/installers/install_gpu_support.sh
RUN bash /tmp/installers/install_ordinary_modules.sh
RUN bash /tmp/installers/install_drivers_deps.sh ${INSTALL_MODE}
RUN bash /tmp/installers/install_dreamview_deps.sh ${GEOLOC}
RUN bash /tmp/installers/install_contrib_deps.sh
RUN bash /tmp/installers/install_release_deps.sh
......
......@@ -2,6 +2,7 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG GEOLOC
ARG CLEAN_DEPS
ARG APOLLO_DIST
ARG INSTALL_MODE
......
......@@ -72,8 +72,11 @@ ldconfig
# Clean up
rm -rf "boost_${VERSION}" "${PKG_NAME}"
apt_get_remove \
liblzma-dev \
libbz2-dev \
libzstd-dev
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove \
liblzma-dev \
libbz2-dev \
libzstd-dev
fi
......@@ -21,6 +21,8 @@ set -e
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
# placeholder
# Clean up cache to reduce layer size.
apt-get clean && \
rm -rf /var/lib/apt/lists/*
......@@ -85,29 +85,32 @@ ldconfig
rm -fr ${PKG_NAME} ffmpeg-${VERSION}
apt_get_remove \
nasm \
yasm \
libx265-dev \
libass-dev \
libfdk-aac-dev \
libmp3lame-dev \
libopus-dev \
libtheora-dev \
libvorbis-dev \
libvpx-dev \
libx264-dev
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove \
nasm \
yasm \
libx265-dev \
libass-dev \
libfdk-aac-dev \
libmp3lame-dev \
libopus-dev \
libtheora-dev \
libvorbis-dev \
libvpx-dev \
libx264-dev
# Don't remove libnuma-dev as it is required by coinor-libipopt1v5
# Don't remove libnuma-dev as it is required by coinor-libipopt1v5
# install runtime-dependencies of ffmpeg
apt_get_update_and_install \
libvpx5 \
libx264-152 \
libx265-146 \
libopus0 \
libmp3lame0 \
libvorbis0a \
libvorbisenc2 \
libfdk-aac1 \
libtheora0
fi
# install runtime-dependencies of ffmpeg
apt_get_update_and_install \
libvpx5 \
libx264-152 \
libx265-146 \
libopus0 \
libmp3lame0 \
libvorbis0a \
libvorbisenc2 \
libfdk-aac1 \
libtheora0
......@@ -157,14 +157,16 @@ if [ "${BUILD_CONTRIB}" = "yes" ]; then
rm -rf "${PKG_CONTRIB}" "opencv_contrib-${VERSION}"
fi
apt_get_remove \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libv4l-dev \
libeigen3-dev \
libopenblas-dev \
libatlas-base-dev \
libxvidcore-dev \
libx264-dev \
libopenni-dev
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libv4l-dev \
libeigen3-dev \
libopenblas-dev \
libatlas-base-dev \
libxvidcore-dev \
libx264-dev \
libopenni-dev
fi
......@@ -120,34 +120,36 @@ ok "Successfully installed PCL ${VERSION}"
# Clean up
rm -fr ${PKG_NAME} pcl-pcl-${VERSION}
# Remove build-deps for PCL
# Note(storypku):
# Please keep libflann-dev as it was required by local_config_pcl
apt_get_remove \
libeigen3-dev \
libglew-dev \
libglfw3-dev \
freeglut3-dev \
libusb-1.0-0-dev \
libdouble-conversion-dev \
libopenni-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
liblz4-dev \
libfreetype6-dev \
libpcap-dev \
libqhull-dev
# Add runtime-deps for pcl
apt_get_update_and_install \
libusb-1.0-0 \
libopenni0 \
libfreetype6 \
libtiff5 \
libdouble-conversion1 \
libpcap0.8 \
libqhull7
if [[ -n "${CLEAN_DEPS}" ]]; then
# Remove build-deps for PCL
# Note(storypku):
# Please keep libflann-dev as it was required by local_config_pcl
apt_get_remove \
libeigen3-dev \
libglew-dev \
libglfw3-dev \
freeglut3-dev \
libusb-1.0-0-dev \
libdouble-conversion-dev \
libopenni-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
liblz4-dev \
libfreetype6-dev \
libpcap-dev \
libqhull-dev
# Add runtime-deps for pcl
apt_get_update_and_install \
libusb-1.0-0 \
libopenni0 \
libfreetype6 \
libtiff5 \
libdouble-conversion1 \
libpcap0.8 \
libqhull7
fi
# Clean up cache to reduce layer size.
apt-get clean && \
......
......@@ -80,5 +80,7 @@ ldconfig
# clean up
rm -rf poco-${VERSION}-release.tar.gz poco-poco-${VERSION}-release
apt_get_remove \
libssl-dev
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove libssl-dev
fi
......@@ -64,12 +64,14 @@ ok "Successfully built proj = ${VERSION}"
rm -fr "${PKG_NAME}" "proj-${VERSION}"
# Remove build-deps for proj
apt_get_remove \
libsqlite3-dev \
sqlite3 \
libtiff-dev \
libcurl4-openssl-dev
if [[ -n "${CLEAN_DEPS}" ]]; then
# Remove build-deps for proj
apt_get_remove \
libsqlite3-dev \
sqlite3 \
libtiff-dev \
libcurl4-openssl-dev
fi
# Clean up cache to reduce layer size.
apt-get clean &&
......
......@@ -23,9 +23,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
. ./installer_base.sh
apt_get_update_and_install libgeos-dev
pip3_install -r py3_requirements.txt
if [ "$(uname -m)" = "x86_64" ]; then
if [[ "$(uname -m)" == "x86_64" ]]; then
pip3_install scipy grpcio-tools
fi
......
......@@ -19,11 +19,7 @@
# Fail on first error.
set -e
if [[ "$1" == "build" ]]; then
BUILD_TYPE="build"
else
BUILD_TYPE="download"
fi
BUILD_TYPE="${1:-download}"
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
......
......@@ -19,11 +19,7 @@
# Fail on first error.
set -e
if [[ "$1" == "build" ]]; then
BUILD_TYPE="build"
else
BUILD_TYPE="download"
fi
BUILD_TYPE="${1:-download}"
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
......
......@@ -104,28 +104,32 @@ info "Ok. Done installing VTK-${VERSION}"
# clean up
rm -rf ${PKG_NAME} VTK-${VERSION}
apt_get_remove \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libeigen3-dev \
liblzma-dev \
libxml2-dev \
liblz4-dev \
libdouble-conversion-dev \
libsqlite3-dev \
libglew-dev \
libtheora-dev \
libogg-dev \
libxt-dev \
libfreetype6-dev \
libjsoncpp-dev \
libhdf5-dev
# install Runtime-deps for VTK
apt_get_update_and_install \
libglew2.0 \
libdouble-conversion1 \
libxml2 \
libjsoncpp1 \
libhdf5-100
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libeigen3-dev \
liblzma-dev \
libxml2-dev \
liblz4-dev \
libdouble-conversion-dev \
libsqlite3-dev \
libglew-dev \
libtheora-dev \
libogg-dev \
libxt-dev \
libfreetype6-dev \
libjsoncpp-dev \
libhdf5-dev
# install Runtime-deps for VTK
apt_get_update_and_install \
libglew2.0 \
libdouble-conversion1 \
libxml2 \
libjsoncpp1 \
libhdf5-100
fi
......@@ -25,14 +25,15 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
# Ref https://classic.yarnpkg.com/en/docs/install/#debian-stable
# Don't use tee here. Or else it complains
# Don't use tee here. It complains
# "Warning: apt-key output should not be parsed (stdout is not a terminal)"
# otherwise.
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
apt-get -y update && \
apt-get -y --no-install-recommends install \
yarn
apt_get_update_and_install yarn
info "Successfully installed yarn"
apt-get clean
rm -fr /etc/apt/sources.list.d/yarn.list
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册