Skip to content

Commit ce7e3f5

Browse files
committed
Update Dockerfile
1 parent 3789f1b commit ce7e3f5

File tree

7 files changed

+109
-11
lines changed

7 files changed

+109
-11
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC-BY-4.0
4+
5+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "github-actions"
10+
directories:
11+
- "/*"
12+
schedule:
13+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC-BY-4.0
4+
5+
name: Build
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
workflow_dispatch:
13+
schedule:
14+
- cron: "0 3 * * MON"
15+
16+
concurrency:
17+
group: build-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: ${{ github.event_name != 'push' }}
19+
20+
env:
21+
TZ: Europe/Berlin
22+
23+
defaults:
24+
run:
25+
shell: bash -Eeuo pipefail {0}
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
if: github.repository_owner == 'OpenMS' || github.event_name == 'workflow_dispatch'
31+
timeout-minutes: 60
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v5
35+
36+
- name: Build image
37+
working-directory: ./docker
38+
run: docker build . &> ${{ runner.temp }}/build-${{ github.run_id }}.log
39+
40+
- name: Upload log
41+
if: always()
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: build-${{ github.run_id }}.log
45+
path: ${{ runner.temp }}/build-${{ github.run_id }}.log
46+
47+
- name: Show log
48+
if: always()
49+
run: cat ${{ runner.temp }}/build-${{ github.run_id }}.log

docker/Dockerfile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
FROM ubuntu_2204
2-
RUN echo "Installing apt packages..."
1+
# syntax=docker/dockerfile:1
32

4-
RUN sudo apt-get -y update >> packages.log
5-
RUN sudo apt-get -y install gawk libssl-dev sshpass libpng-dev libudunits2-dev libcairo2-dev libgdal-dev r-base r-base-dev pandoc python3 python-is-python3 >> packages.log
3+
FROM debian:trixie-slim
64

7-
RUN export RSTUDIO_PANDOC=/usr/bin/
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
ENV GNUMAKEFLAGS="-j2 --no-print-directory --output-sync=target"
7+
ENV MAKEFLAGS="-j2 --no-print-directory --output-sync=target"
88
ENV RSTUDIO_PANDOC=/usr/bin
9+
ENV TZ=Europe/Berlin
910

10-
RUN echo "Installing R packages..."
11-
## mapview not needed anymore
12-
COPY Rpackages.R Rpackages.R
13-
RUN sudo Rscript --vanilla Rpackages.R
11+
SHELL ["/bin/bash", "-Eeuxo", "pipefail", "-c"]
12+
13+
COPY docker_scripts /docker_scripts
14+
15+
# Disable compiler warnings when R compiles packages from source.
16+
ENV EXTRA_CXXFLAGS=-w
17+
COPY config/Makevars /root/.R/Makevars
18+
19+
RUN /docker_scripts/install_apt_packages.sh
20+
RUN /docker_scripts/install_R_packages.R

docker/Rpackages.R

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker/config/Makevars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CFLAGS+= -w
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env Rscript
2+
3+
install.packages(c('ggplot2','scholar','knitr','rmarkdown','leaflet','rworldmap','lattice','RColorBrewer','sp'), repos='https://cloud.r-project.org/')
4+
q()
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash -l
2+
3+
set -Eeuxo pipefail
4+
5+
apt-get update 1>/dev/null
6+
7+
# sudo is not needed but still installed for compatibility
8+
apt-get install --yes --no-install-recommends \
9+
ca-certificates \
10+
gawk \
11+
libabsl-dev \
12+
libcairo2-dev \
13+
libgdal-dev \
14+
libpng-dev \
15+
libssl-dev \
16+
libudunits2-dev \
17+
pandoc \
18+
python-is-python3 \
19+
python3 \
20+
r-base \
21+
r-base-dev \
22+
sshpass \
23+
sudo \
24+
1>/dev/null
25+
26+
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)