httpgd can display R
plots from Docker containers without X11 forwarding.
Set httpgd.host and httpgd.port options in
the Rprofile so hgd() uses them automatically:
FROM r-base:latest
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfontconfig1-dev \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* \
&& install2.r --error --skipinstalled --ncpu -1 \
httpgd \
&& rm -rf /tmp/downloaded_packages
RUN echo 'options(httpgd.host = "0.0.0.0", httpgd.port = 8888)' >> /etc/R/Rprofile.site
EXPOSE 8888