Skip to content

Commit

Permalink
refactor Dockerfile to optimize package installation and reduce unnec…
Browse files Browse the repository at this point in the history
…essary dependencies
  • Loading branch information
marc-hanheide committed Dec 11, 2024
1 parent 83cbe85 commit dda6e09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Dockerfile.opengl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ENV ROS_DISTRO=${ROS_DISTRO}
ENV DEBIAN_FRONTEND=noninteractive

# Install language
RUN apt-get update && apt-get install -y \
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
locales \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
Expand All @@ -19,7 +21,7 @@ ENV LANG en_US.UTF-8
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y tzdata \
&& apt-get install -y --no-install-recommends tzdata \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -81,7 +83,8 @@ ENV DEBIAN_FRONTEND=
FROM base AS dev

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash-completion \
build-essential \
cmake \
Expand All @@ -106,7 +109,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# Add sudo support for the non-root user
&& apt-get update \
&& apt-get install -y sudo \
&& apt-get install -y --no-install-recommends sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit dda6e09

Please sign in to comment.