Skip to content

Commit

Permalink
Merge pull request #10254 from pjonsson/dockerfile-rm-right
Browse files Browse the repository at this point in the history
ubuntu/Dockerfile: fix rm & remove apt lists
  • Loading branch information
rouault committed Jun 20, 2024
2 parents 90d38f5 + adc81b5 commit 6a803e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docker/ubuntu-full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ COPY ./bh-set-envvars.sh /buildscripts/bh-set-envvars.sh

RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${TARGET_ARCH}" != ""; then \
rm -f /etc/apt/sources.list \
rm -f /etc/apt/sources.list.d/ubuntu.sources \
rm -f /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe" >> /etc/apt/sources.list \
Expand Down Expand Up @@ -134,6 +133,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libspdlog-dev${APT_ARCH_SUFFIX} libmagic-dev${APT_ARCH_SUFFIX} \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir tiledb \
&& wget -q https://github.com/TileDB-Inc/TileDB/archive/${TILEDB_VERSION}.tar.gz -O - \
| tar xz -C tiledb --strip-components=1 \
Expand Down
3 changes: 2 additions & 1 deletion docker/ubuntu-full/bh-proj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ else
fi

apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y patchelf
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y patchelf
rm -rf /var/lib/apt/lists/*
patchelf --set-soname libinternalproj.so.${PROJ_SO_FIRST} ${DESTDIR}${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO}
for i in "${DESTDIR}${PROJ_INSTALL_PREFIX}/bin"/*; do
patchelf --replace-needed libproj.so.${PROJ_SO_FIRST} libinternalproj.so.${PROJ_SO_FIRST} $i;
Expand Down
6 changes: 3 additions & 3 deletions docker/ubuntu-small/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ COPY ./bh-set-envvars.sh /buildscripts/bh-set-envvars.sh

RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${TARGET_ARCH}" != ""; then \
rm -f /etc/apt/sources.list \
rm -f /etc/apt/sources.list.d/ubuntu.sources \
rm -f /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe" >> /etc/apt/sources.list \
Expand Down Expand Up @@ -138,7 +137,8 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& ${GCC_ARCH}-linux-gnu-strip -s /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO} \
&& for i in /build${PROJ_INSTALL_PREFIX}/bin/*; do ${GCC_ARCH}-linux-gnu-strip -s $i 2>/dev/null || /bin/true; done \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y patchelf \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y patchelf \
&& rm -rf /var/lib/apt/lists/* \
&& patchelf --set-soname libinternalproj.so.${PROJ_SO_FIRST} /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO} \
&& for i in /build${PROJ_INSTALL_PREFIX}/bin/*; do patchelf --replace-needed libproj.so.${PROJ_SO_FIRST} libinternalproj.so.${PROJ_SO_FIRST} $i; done

Expand Down

0 comments on commit 6a803e6

Please sign in to comment.