rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

apt-get install failing for libssl-dev with dpkg error in docker build #506

Closed palayoov closed 1 year ago

palayoov commented 1 year ago

Hi, When rebuilding my base images and installing baseline dependencies for my R script, I am getting new errors that I was not receiving before. They are failing on the installation of libssl-dev. I have tried tag as far as back as 4.1.3 but will go farther to see if it goes away. Any ideas?

The error is:

[6/7] RUN apt-get install -y libssl-dev:

10 0.406 Reading package lists...

10 1.085 Building dependency tree...

10 1.265 Reading state information...

10 1.462 The following additional packages will be installed:

10 1.463 libc-bin libc-dev-bin libc-l10n libc6 libc6-dev libssl3 locales

10 1.464 Suggested packages:

10 1.464 glibc-doc libnss-nis libnss-nisplus manpages-dev libssl-doc

10 1.464 Recommended packages:

10 1.464 manpages manpages-dev libc-devtools

10 1.574 The following NEW packages will be installed:

10 1.575 libssl-dev libssl3

10 1.576 The following packages will be upgraded:

10 1.577 libc-bin libc-dev-bin libc-l10n libc6 libc6-dev locales

10 1.719 6 upgraded, 2 newly installed, 0 to remove and 197 not upgraded.

10 1.719 Need to get 14.3 MB of archives.

10 1.719 After this operation, 14.9 MB of additional disk space will be used.

10 1.719 Get:1 http://deb.debian.org/debian testing/main amd64 libc-l10n all 2.35-3 [671 kB]

10 1.987 Get:2 http://deb.debian.org/debian testing/main amd64 libc-dev-bin amd64 2.35-3 [42.0 kB]

10 1.998 Get:3 http://deb.debian.org/debian testing/main amd64 libc6-dev amd64 2.35-3 [1,892 kB]

10 2.245 Get:4 http://deb.debian.org/debian testing/main amd64 locales all 2.35-3 [3,898 kB]

10 2.871 Get:5 http://deb.debian.org/debian testing/main amd64 libc6 amd64 2.35-3 [2,737 kB]

10 3.182 Get:6 http://deb.debian.org/debian testing/main amd64 libc-bin amd64 2.35-3 [616 kB]

10 3.263 Get:7 http://deb.debian.org/debian testing/main amd64 libssl3 amd64 3.0.5-4 [2,031 kB]

10 3.546 Get:8 http://deb.debian.org/debian testing/main amd64 libssl-dev amd64 3.0.5-4 [2,443 kB]

10 4.007 debconf: delaying package configuration, since apt-utils is not installed

10 4.034 Fetched 14.3 MB in 2s (6,261 kB/s)

(Reading database ... 18300 files and directories currently installed.)

10 4.063 Preparing to unpack .../libc-l10n_2.35-3_all.deb ...

10 4.074 Unpacking libc-l10n (2.35-3) over (2.33-7) ...

10 4.255 Preparing to unpack .../libc-dev-bin_2.35-3_amd64.deb ...

10 4.265 Unpacking libc-dev-bin (2.35-3) over (2.33-7) ...

10 4.304 Preparing to unpack .../libc6-dev_2.35-3_amd64.deb ...

10 4.314 Unpacking libc6-dev:amd64 (2.35-3) over (2.33-7) ...

10 5.291 Preparing to unpack .../locales_2.35-3_all.deb ...

10 5.302 Unpacking locales (2.35-3) over (2.33-7) ...

10 6.730 Preparing to unpack .../libc6_2.35-3_amd64.deb ...

10 6.816 Checking for services that may need to be restarted...

10 6.821 Checking init scripts...

10 6.834 Unpacking libc6:amd64 (2.35-3) over (2.33-7) ...

10 7.562 Setting up libc6:amd64 (2.35-3) ...

10 7.642 Checking for services that may need to be restarted...

10 7.647 Checking init scripts...

10 7.647 Nothing to restart.

10 8.677 dpkg: error: error executing hook 'if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi', exit code 32512

10 8.682 E: Sub-process /usr/bin/dpkg returned an error code (2)

FROM r-base:latest

## create directories
#RUN mkdir -p /code

## copy install packages
COPY install_packages.R /code/

## install R-packages
RUN apt-get update
RUN apt-get install -y build-essential libssl-dev libxml2-dev libcurl4-openssl-dev libmysqlclient-dev

RUN Rscript /code/install_packages.R
eddelbuettel commented 1 year ago

Did you check if the package had any recent bug reports?

It just worked for me (apt update; apt install libssl-dev) in rocker/r-base and in r-base. Note that there were some recent issue due to the '/usrmerg' upgrade in Debian. I had rebuilt rocker/r-base but not (yet) r-base for that -- this will happen when R 4.2.2 comes out in a week and one day.

palayoov commented 1 year ago

Thanks so much for the quick response. I am trying the rocker/r-base:latest image now, and now it seems to fail on the apt-get update with this:

[2/5] COPY install_packages.R /code/                                                             0.3s 
ERROR [3/5] RUN apt-get update                                                                   6.3s 
------
 > [3/5] RUN apt-get update:
#6 0.541 Get:2 http://deb.debian.org/debian testing InRelease [164 kB]
#6 0.636 Get:1 http://cdn-fastly.deb.debian.org/debian sid InRelease [161 kB]
#6 0.749 Get:3 http://deb.debian.org/debian-security testing-security InRelease [48.0 kB]
#6 0.817 Get:4 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages [9,384 kB]
#6 0.877 Get:5 http://deb.debian.org/debian testing-updates InRelease [49.6 kB]
#6 0.926 Get:6 http://deb.debian.org/debian testing/main amd64 Packages [8,694 kB]
#6 5.493 Fetched 18.5 MB in 5s (3,570 kB/s)
#6 5.493 Reading package lists...
#6 6.235 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#6 6.235 E: Sub-process returned an error code
eddelbuettel commented 1 year ago

No idea. I just used it two minutes ago to illustrate a StackOverflow answer which its OP still had issues with. "Works here". Not sure what to say.

Maybe the usual stuff. Is your docker (package and daemon) current? Could anything else differ? I am on Ubuntu 22.04 but that should not matter.

palayoov commented 1 year ago

I thought Docker was supposed to solve the "works on my machine" problem... 🙂 Thanks, I am running Windows with WSL Ubuntu 20.04.1...maybe that's my problem. Clearly seems to be a local problem, will try a few more things and update.

palayoov commented 1 year ago

So it was definitely an environmental issue with my Docker desktop. @eddelbuettel your thought about ubuntu version got me thinking about my Docker desktop version and indeed I had an outdated version of Docker desktop. Once I updated the version of Docker desktop my problem went away and no changes were required to my Dockerfile.

With this new update, I had no issues with my build.

eddelbuettel commented 1 year ago

That part is oddly non-transparent about Docker, and the error messages give no hint whatsoever. Glad you got it sorted out.