Unable to install devtools

I am trying to build this on a docker image and it used to work a couple of months ago but now it fails with I try installing R devtools

FROM python:3.8

RUN apt update
RUN apt install jq nodejs npm node-gyp dirmngr gnupg apt-transport-https ca-certificates software-properties-common cpio -y
RUN apt install r-base libfontconfig1-dev -y
RUN apt install build-essential -y

ENV LIBARROW_MINIMAL=false

RUN which R

RUN R -q -e 'if(!require(devtools)) install.packages("devtools", repos = "http://cran.us.r-project.org")'

Errors:

ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’
* removing ‘/usr/local/lib/R/site-library/devtools’

The downloaded source packages are in
        ‘/tmp/RtmpvUFgBH/downloaded_packages’
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘devtools’
2: In install.packages("devtools", repos = "http://cran.us.r-project.org") :
  installation of package ‘textshaping’ had non-zero exit status
3: In install.packages("devtools", repos = "http://cran.us.r-project.org") :
  installation of package ‘ragg’ had non-zero exit status
4: In install.packages("devtools", repos = "http://cran.us.r-project.org") :
  installation of package ‘pkgdown’ had non-zero exit status
5: In install.packages("devtools", repos = "http://cran.us.r-project.org") :
  installation of package ‘devtools’ had non-zero exit status

Is there a way to fix these or to install these packages without compiling them?

I do not have experience with docker but this seems pretty straight forward, you need to install pkgdown before installing devtools.

If your base docker image is based on a supported Linux distro, you can use the public RStudio Package Manager that offers precompiled binaries.

try to install it directly from the R repository :

I think you are missing the point, the OP is trying to set up a Docker image, so packages need to be installed programmatically not through the IDE's GUI.

Hi. Thanks for your answers!

Apparently, I also have to install libharfbuzz-dev and libfribidi-dev (apt install libharfbuzz-dev libfribidi-dev).

Take a look at this project

It provides R packages as Ubuntu deb packages so apt automatically solves any system dependencies :exploding_head:. They also provide very performant docker base images with all the configuration needed to use their repo.