Skip to content
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

chore(docker): Refine Dockerfile's ARG usage #4648

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 10 additions & 11 deletions docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
wget \
cmake \
curl \
gosu \

Check warning on line 16 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (gosu)
gnupg \
vim \
unzip \
lsb-release \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache

# Add GitHub to known hosts for private repositories
RUN mkdir -p ~/.ssh \
Expand All @@ -34,7 +34,7 @@
./setup-dev-env.sh -y --module base --runtime openadk \
&& pip uninstall -y ansible ansible-core \
&& pip install vcstool \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc

# Create entrypoint
Expand All @@ -44,7 +44,6 @@
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ARG SETUP_ARGS
ARG ROS_DISTRO
ENV CCACHE_DIR="/var/tmp/ccache"
ENV CC="/usr/lib/ccache/gcc"
ENV CXX="/usr/lib/ccache/g++"
Expand All @@ -53,9 +52,9 @@
RUN --mount=type=ssh \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadk \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache \
&& find / -name 'libcu*.a' -delete \

Check warning on line 56 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (libcu)
&& find / -name 'libnv*.a' -delete

Check warning on line 57 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (libnv)

# Copy repository files
COPY autoware.repos /autoware/
Expand All @@ -66,16 +65,16 @@
&& vcs import src < autoware.repos \
&& apt-get update \
&& rosdep update \
&& DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \
&& source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro ${ROS_DISTRO} \
&& source /opt/ros/${ROS_DISTRO}/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \
" -Wno-dev" \
" --no-warn-unused-cli" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
&& find /autoware/install -type d -exec chmod 777 {} \; \
&& chmod -R 777 /var/tmp/ccache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache \
&& rm -rf /autoware/build /autoware/src

CMD ["/bin/bash"]
Expand All @@ -87,7 +86,7 @@
RUN --mount=type=ssh \
./setup-dev-env.sh -y --module dev-tools --download-artifacts openadk \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache

# Create entrypoint
COPY docker/autoware-openadk/etc/ros_entrypoint.sh /ros_entrypoint.sh
Expand All @@ -109,14 +108,14 @@
&& mkdir src \
&& vcs import src < autoware.repos \
&& rosdep update \
&& DEBIAN_FRONTEND=noninteractive rosdep install -y --dependency-types=exec --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& DEBIAN_FRONTEND=noninteractive rosdep install -y --dependency-types=exec --ignore-src --from-paths src --rosdistro ${ROS_DISTRO} \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* ${HOME}/.cache \
&& find /usr/lib/$LIB_DIR-linux-gnu -name "*.a" -type f -delete \
&& find / -name "*.o" -type f -delete \
&& find / -name "*.h" -type f -delete \
&& find / -name "*.hpp" -type f -delete \
&& rm -rf /autoware/src /autoware/ansible /autoware/autoware.repos \
/root/.local/pipx /opt/ros/"$ROS_DISTRO"/include /etc/apt/sources.list.d/cuda*.list \
/root/.local/pipx /opt/ros/${ROS_DISTRO}/include /etc/apt/sources.list.d/cuda*.list \
/etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \
/usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm*

Expand Down
Loading