Skip to content

Commit

Permalink
Updated docker image to quarto 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
royfrancis committed Feb 19, 2024
1 parent 74459b7 commit e458c66
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
REGISTRY: ghcr.io
ORG: nbisweden
IMAGE: workshop-ngsintro/workshop-ngsintro:latest
IMAGE: workshop-ngsintro:latest

jobs:
quarto-render-job:
Expand Down
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# DOCKER FILE FOR WORKSHOP-NGSINTRO
# 2024 Roy Francis

FROM rocker/verse:4.2.3
LABEL Description="Docker image for NBIS workshop"
LABEL Maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/NBISweden/workshop-ngsintro"
ARG QUARTO_VERSION="1.4.549"

RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
libxml2-dev \
libssl-dev \
libcurl4-openssl-dev \
libudunits2-dev \
libopenblas-base \
libgdal-dev \
curl \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install -y ./google-chrome-stable_current_amd64.deb \
&& rm -rf ./google-chrome-stable_current_amd64.deb \
&& curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \
&& apt-get install -y ./quarto-linux-amd64.deb \
&& rm -rf ./quarto-linux-amd64.deb \
&& Rscript -e 'install.packages(c("remotes","fontawesome","here","htmlTable","leaflet","readxl","writexl"),repos = "http://cran.us.r-project.org");' \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /qmd /.cache \
&& chmod 777 /qmd /.cache

## Required when editing rnaseq
## RUN Rscript -e 'BiocManager::install(c("DESeq2","edgeR","goseq","GO.db","org.Mm.eg.db","reactome.db"));'
WORKDIR /qmd
#ENV XDG_CACHE_HOME=/tmp/quarto_cache_home
#ENV XDG_DATA_HOME=/tmp/quarto_data_home
CMD quarto render

26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,40 @@ Clone the repo if not already done. Make sure you are standing in the repo direc
To build the complete site,

```
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro/workshop-ngsintro
docker run --platform linux/amd64 --rm -u 1000:1000 -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro
```

To build a single file (for example `index.qmd`),

```
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro/workshop-ngsintro quarto render index.qmd
docker run --platform linux/amd64 --rm -u 1000:1000 -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro quarto render index.qmd
```

:exclamation: Output files are for local preview only. Do not push any rendered .html files or intermediates.

## Repo organisation

The source material is located on the *master* branch (default). The rendered material is located on the *gh-pages* branch. One only needs to update content in master. Changes pushed to the *master* branch is automatically rendered to the *gh-pages* branch.
The source material is located on the *master* branch (default). The rendered material is located on the *gh-pages* branch. One only needs to update source materials in *master*. Changes pushed to the *master* branch is automatically rendered to the *gh-pages* branch using github actions.

:exclamation: Every push rebuilds the whole website using a docker image. Build takes about 4-5 mins.
:exclamation: Every push rebuilds the whole website using a pre-built docker image.

This repo is loosely based on the quarto template [specky](https://github.com/royfrancis/specky).

## Building docker container

```bash
# build container
docker build --platform linux/amd64 -t ghcr.io/nbisweden/workshop-ngsintro:2.3.0 -t ghcr.io/nbisweden/workshop-ngsintro:latest .

# push to ghcr
# docker login ghcr.io
docker push ghcr.io/nbisweden/workshop-ngsintro:2.3.0
docker push ghcr.io/nbisweden/workshop-ngsintro:latest

# run container in the root of the repo
docker run --rm --platform linux/amd64 -u 1000:1000 -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro:latest
docker run --rm --platform linux/amd64 -u 1000:1000 -v ${PWD}:/qmd ghcr.io/nbisweden/workshop-ngsintro:latest quarto render index.qmd
```

## Test scripts

Expand Down

0 comments on commit e458c66

Please sign in to comment.