Skip to content

Commit

Permalink
adds python3 and radian as well as tinytex installl in default directory
Browse files Browse the repository at this point in the history
  • Loading branch information
francojc committed Sep 20, 2024
1 parent 8b68083 commit 6bda588
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile
# R, Pandoc, Quarto, and key R packages
# R/Python, Pandoc, Quarto, and key R packages

FROM rocker/r-ver:4.4.1

Expand All @@ -9,8 +9,10 @@ ENV PANDOC_VERSION="3.1.11.1"
ENV QUARTO_VERSION="1.5.56"

RUN apt-get update && apt-get install -y \
perl-modules \
libcurl4-openssl-dev \
perl-modules \
python3 \
pip \
sudo

RUN /rocker_scripts/install_pandoc.sh && /rocker_scripts/install_quarto.sh
Expand All @@ -22,9 +24,9 @@ RUN usermod -aG sudo ${DEFAULT_USER} && \

USER $DEFAULT_USER

RUN R -q -e "install.packages(c('pak', 'tinytex', 'renv', 'knitr', 'rmarkdown'), repos = c('https://cloud.r-project.org/', 'https://r-lib.r-universe.dev'));" \
&& R -q -e "tinytex::install_tinytex(dir = '~/.local/bin/')"
RUN pip3 install -U radian

RUN rm -rf ~/bin
RUN R -q -e "install.packages(c('pak', 'tinytex', 'renv', 'knitr', 'rmarkdown'), repos = c('https://cloud.r-project.org/', 'https://r-lib.r-universe.dev'));" \
&& R -q -e "tinytex::install_tinytex(force = TRUE)"

CMD ["bash"]
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ This repo contains the Dockerfile for the base image to set up an environment to
Properties:

- Based on the rocker/r-ver:4.4.1 image
- Installs Pandoc (3.1.11.1) and Quarto (1.5.56)
- Installs Python3, radian, Pandoc (3.1.11.1) and Quarto (1.5.56)
- Creates a non-root user `ruser` with passwordless `sudo` access
- Installs R packages: {pak}, {renv}, {knitr}, {rmarkdown} and {tinytext}, as well as running the TinyTex installer adding the executables to `~/.local/bin/`

## Usage

The image can be found on Docker Hub at [qtalr/qtalr-r](https://hub.docker.com/r/qtalr/qtalr-r). To use it, you can run:
The image can be found on Docker Hub at [francojc/qtalr-r](https://hub.docker.com/r/francojc/qtalr-r). To use it, you can run:

```bash

docker run -it qtalr/qtalr-r:latest
docker run -it francojc/qtalr-r:latest

```

Or you can create a container with a volume to mount your local directory:

```bash
docker run -it -v /path/to/your/local/directory:/home/ruser qtalr/qtalr-r:latest
docker run -it -v /path/to/your/local/directory:/home/ruser francojc/qtalr-r:latest
```

Alternatively, you can use Docker Desktop to run the image and connect it to a host directory.
Expand All @@ -31,16 +31,9 @@ Alternatively, you can use Docker Desktop to run the image and connect it to a h

Other images that extend this image include:

- qtalr-rstudio\
Installs RStudio Server. You will need to specify the `PASSWORD` environment variable and the port to map to the host machine which defaults to 8787. To run this from the command line:

```bash
docker run -d -p 8787:8787 -e PASSWORD=yourpassword qtalr/qtalr-rstudio:latest
```

Or use Docker Desktop and include these variables and values using the GUI interface.

- qtalr-vscode (coming soon)
- qtalr-neovim (coming soon)
- francojc/qtalr-rstudio\
Includes RStudio.
- francojc/qtalr-vscode (coming soon)
- francojc/qtalr-neovim (coming soon)

You can of course extend this image to create your own custom image.

0 comments on commit 6bda588

Please sign in to comment.