diff --git a/docker/Dockerfile b/docker/Dockerfile index b9fccae..05f8bea 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,9 @@ ARG BASE_IMAGE=ros:noetic-ros-base-focal FROM ${BASE_IMAGE} +ADD sources.list /etc/apt/ #change the source into tuna's mirror # install ros packages -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' && \ #setup sources.list using the tuna's mirror in order to install the following ROS packages and google-glog library without errors + apt-get update && apt-get install -y --no-install-recommends \ ros-${ROS_DISTRO}-tf ros-${ROS_DISTRO}-nav-msgs ros-${ROS_DISTRO}-geometry-msgs libgoogle-glog-dev \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /root/catkin_ws/src diff --git a/docker/sources.list b/docker/sources.list new file mode 100644 index 0000000..d1f656d --- /dev/null +++ b/docker/sources.list @@ -0,0 +1,9 @@ +# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse +deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse +deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse +deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse +deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse