Skip to content

Commit f0eb444

Browse files
committed
Add git, gh, ragg to python and pythonr images
1 parent e670f17 commit f0eb444

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

python/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
FROM python:3.12-slim-bookworm
22

3-
# Install wget, unzip, git, and build tools (needed for compiling packages like matplotlib)
4-
RUN apt update && apt install -y \
3+
# Install dependencies, git, and gh cli
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
55
wget \
66
unzip \
77
git \
88
build-essential \
9+
curl \
10+
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
11+
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
12+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list \
13+
&& apt-get update \
14+
&& apt-get install -y gh \
915
&& rm -rf /var/lib/apt/lists/*
1016

1117
# Install quarto

pythonr/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
FROM ghcr.io/geocompx/python
22

3-
# Install R
3+
# Install R and locales
44
RUN apt-get update && apt-get install -y --no-install-recommends \
5-
wget \
65
ca-certificates \
76
libcurl4-openssl-dev \
87
libssl-dev \
98
libxml2-dev \
109
libtcl8.6 \
1110
libtk8.6 \
11+
locales \
12+
&& locale-gen C.UTF-8 \
1213
&& rm -rf /var/lib/apt/lists/*
1314

14-
# Set up locale for R installation
15-
RUN apt-get update && apt-get install -y locales && locale-gen C.UTF-8 && rm -rf /var/lib/apt/lists/*
1615
ENV LANG=C.UTF-8
1716
ENV LC_ALL=C.UTF-8
1817

@@ -42,11 +41,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4241
cmake \
4342
&& rm -rf /var/lib/apt/lists/*
4443

44+
# Install ragg and its dependencies for high-quality headless graphics
45+
RUN R -e "install.packages(c('ragg', 'systemfonts', 'textshaping'))"
46+
47+
# Configure R to use ragg as the default graphics device
48+
RUN mkdir -p /etc/R && \
49+
echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" > /etc/R/Rprofile.site && \
50+
echo "if (requireNamespace('ragg', quietly = TRUE)) { options(device = ragg::agg_png) }" >> /etc/R/Rprofile.site && \
51+
echo 'options(Ncpus = parallel::detectCores())' >> /etc/R/Rprofile.site
4552

46-
# Configure rspm
47-
RUN mkdir -p /etc/R
48-
RUN echo 'options(repos = c(CRAN = "https://packagemanager.rstudio.com/all/latest"))' > /etc/R/Rprofile.site
49-
RUN echo 'options(Ncpus = parallel::detectCores())' >> /etc/R/Rprofile.site
5053
# Install sf:
5154
RUN R -e "install.packages('sf', repos = 'https://cloud.r-project.org')"
5255
# Install remotes for GitHub installs:

0 commit comments

Comments
 (0)