Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^LICENSE\.md$
.github
Dockerfile
Dockerfile\.positron
_pkgdown.yml
^.*\.Rproj$
^\.Rproj\.user$
25 changes: 25 additions & 0 deletions Dockerfile.positron
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM bioconductor/bioconductor_docker:devel

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openssh-server r-bioc-biobase \
&& cp -a /usr/lib/R/site-library/BiocGenerics /usr/local/lib/R/site-library/ \
&& cp -a /usr/lib/R/site-library/Biobase /usr/local/lib/R/site-library/ \
&& mkdir -p /var/run/sshd /etc/ssh/sshd_config.d \
&& printf '%s\n' \
'PasswordAuthentication yes' \
'PermitRootLogin no' \
'AllowUsers rstudio' \
'AllowTcpForwarding yes' \
'AllowStreamLocalForwarding yes' \
> /etc/ssh/sshd_config.d/positron.conf \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /home/rstudio

COPY --chown=rstudio:rstudio . /home/rstudio/

RUN Rscript -e "options(repos = c(CRAN = 'https://cran.r-project.org')); devtools::install('.', dependencies=FALSE, build_vignettes=TRUE, upgrade=FALSE)"

EXPOSE 22

CMD ["/bin/bash", "-lc", "set -euo pipefail; : \"${PASSWORD:?Set PASSWORD to enable SSH login}\"; echo \"rstudio:${PASSWORD}\" | chpasswd; ssh-keygen -A >/dev/null 2>&1; exec /usr/sbin/sshd -D -e"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ docker run -e PASSWORD=abc -p 8787:8787 ghcr.io/bioconductor/buildabiocworkshop
in a multi-user system (like a shared workstation or compute node). In practice, consider using an environment
variable instead of plain text to pass along passwords and other secrets in docker command lines.

## Alternative: connect from Positron over SSH

This repository also includes `Dockerfile.positron`, which keeps the Bioconductor
base image and package installation steps but starts an SSH server instead of
RStudio Server. Build it explicitly with:

```sh
docker build -f Dockerfile.positron -t buildabiocworkshop-positron .
export PASSWORD='choose-a-password'
docker run --rm --env PASSWORD -p 2222:22 buildabiocworkshop-positron
```

Then connect to `ssh://rstudio@localhost:2222` from a local Positron install
using the same password you supplied in `PASSWORD`.


## Whatcha get

Expand Down
5 changes: 3 additions & 2 deletions vignettes/HOWTO_BUILD_WORKSHOP.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ Edit the file _pkgdown.yml, updating the url:, title and href: which should be y
### 5. Edit `.github/workflows yaml` as needed (likely no need)


You do not need to create a docker image manually. Github actions will read Dockerfile located in this template, and using the yaml files will create, build and push to the Github Container Registry an image with the name (default) `ghcr.io/yourgithubuser/yourgithubreponame`, all lowercase.
You do not need to create a docker image manually. Github actions will read `Dockerfile` located in this template, and using the yaml files will create, build and push to the Github Container Registry an image with the name (default) `ghcr.io/yourgithubuser/yourgithubreponame`, all lowercase.

If you want a Positron-oriented alternative, this template also ships with `Dockerfile.positron`. Build that variant explicitly with `docker build -f Dockerfile.positron .`; it starts `sshd` so that a locally installed Positron client can attach with Remote SSH instead of using RStudio Server in the browser.
Comment on lines +75 to +77


In the DESCRIPTION file, the **DockerImage: should match your the docker image name (should be lowercase)**.
Expand All @@ -82,4 +84,3 @@ In the DESCRIPTION file, the **DockerImage: should match your the docker image n

Edit the README.md. and add one or more Rmd vignettes that will constitute the workshop materials. It is normal R package that should pass `rcmdcheck::rcmdcheck()`, and be installed using regular R package install commands.


Loading