Skip to content
Open
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
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
* text=auto

# Files under a files/ directory are COPY'd into Docker images and
# run/sourced as Unix scripts. Force LF line endings on checkout so a
# fresh enlistment is always correct, regardless of the checkout
# machine's core.autocrlf setting.
**/files/** text eol=lf
22 changes: 22 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: hadolint

"on":
pull_request:
branches:
- develop

jobs:
hadolint:
name: hadolint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run hadolint (R images)
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: images/labkey/*/Dockerfile
recursive: true
failure-threshold: 'warning'
ignore: 'DL3008' # Don't worry about pinning versions
16 changes: 16 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: 'Run Shellcheck'

"on":
- pull_request

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
26 changes: 26 additions & 0 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Workflow to validate Pull Request branches
name: PR Validation

# Trigger on PR creation
"on":
pull_request:
types:
- opened
- reopened
- ready_for_review

jobs:
validate_pr:
if: github.event.pull_request.head.repo.owner.login == 'LabKey'
runs-on: ubuntu-latest

steps:
- name: Validate PR Branches
uses: LabKey/gitHubActions/validate-pr@develop
with:
pr_base: ${{ github.event.pull_request.base.ref }}
pr_head: ${{ github.event.pull_request.head.ref }}
pr_number: ${{ github.event.pull_request.number }}
pr_title: ${{ github.event.pull_request.title }}
github_token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: 'Yamllint GitHub Actions'

"on":
- pull_request

jobs:
yamllint:
name: 'Yamllint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v6

- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.claude/
31 changes: 31 additions & 0 deletions images/labkey/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build the LabKey R Docker images.
#
# Usage:
# make <target> [R_VERSION=<tag>]
#
# Targets:
# r labkey/r (from ubuntu; version is fixed in the Dockerfile)
# rsandbox labkey/rsandbox (from rocker/r-ver:$(R_VERSION))
# rstudio-base labkey/rstudio-base (from rocker/rstudio:$(R_VERSION))
# rstudio labkey/rstudio (from labkey/rstudio-base:$(R_VERSION); builds rstudio-base first)
# all build every image above
#
# Requires Docker 17.05.0 or greater.

.PHONY: all r rsandbox rstudio-base rstudio

R_VERSION ?= latest

all: r rsandbox rstudio-base rstudio

r:
docker build -t labkey/r:latest r

rsandbox:
docker build --build-arg VERSION=$(R_VERSION) -t labkey/rsandbox:$(R_VERSION) rsandbox

rstudio-base:
docker build --build-arg VERSION=$(R_VERSION) -t labkey/rstudio-base:$(R_VERSION) rstudio-base

rstudio: rstudio-base
docker build --build-arg VERSION=$(R_VERSION) -t labkey/rstudio:$(R_VERSION) rstudio
21 changes: 10 additions & 11 deletions images/labkey/r/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
ARG VERSION=18.04
ARG VERSION=24.04
FROM ubuntu:${VERSION}

RUN apt-get update && \
apt-get install -y --no-install-recommends apt-transport-https apt-utils software-properties-common

RUN apt-get install -y --no-install-recommends build-essential dos2unix libopenblas-dev libssl-dev libxml2-dev nano pandoc procps xvfb x11-common

# NOTE much faster to use apt to install prebuilt packages than using "install.packages()"
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-get install -y --no-install-recommends apt-transport-https apt-utils software-properties-common && \
apt-get install -y --no-install-recommends build-essential libopenblas-dev libssl-dev libxml2-dev nano pandoc procps xvfb x11-common && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
r-base \
r-cran-bitops \
r-cran-cairo \
Expand All @@ -28,12 +25,14 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
r-cran-markdown \
r-cran-scales \
r-cran-stringr \
r-cran-tidyr
r-cran-tidyr && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY install.R /tmp/
RUN R --vanilla -f /tmp/install.R
COPY files/install.R /tmp/
RUN R --vanilla -f /tmp/install.R

RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles/etc/localtime && \
RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata

RUN R --version
File renamed without changes.
36 changes: 0 additions & 36 deletions images/labkey/rsandbox-ver/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions images/labkey/rsandbox-ver/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions images/labkey/rsandbox-ver/install.R

This file was deleted.

9 changes: 0 additions & 9 deletions images/labkey/rsandbox-ver/make

This file was deleted.

1 change: 0 additions & 1 deletion images/labkey/rsandbox-ver/make.bat

This file was deleted.

9 changes: 4 additions & 5 deletions images/labkey/rsandbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG VERSION=3.6.3
ARG VERSION=latest
FROM rocker/r-ver:${VERSION}

RUN apt-get update && \
apt-get install -y --no-install-recommends apt-transport-https apt-utils software-properties-common && \
apt-get install -y --no-install-recommends build-essential dos2unix libopenblas-dev libxml2-dev nano pandoc procps xvfb x11-common && \
apt-get install -y --no-install-recommends build-essential libopenblas-dev libxml2-dev nano pandoc procps xvfb x11-common libuv1-dev && \
apt-get install -y --no-install-recommends sudo && \
apt-get install -y --no-install-recommends \
curl libcurl4-openssl-dev \
Expand All @@ -28,9 +28,8 @@ RUN useradd docker || true \
&& chmod -R 775 /home/docker || true


COPY install.R /
RUN dos2unix install.R && \
R --no-site-file -f install.R && \
COPY files/install.R /
RUN R --no-site-file -f install.R && \
chmod -R 755 /usr/local/lib/R/site-library

CMD ["su", "docker", "-c", "/bin/bash"]
6 changes: 3 additions & 3 deletions images/labkey/rsandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ labkey/rsandbox:latest

Dockerfile for building Dockerized LabKey R image using with the latest R release version.

Run `./make` to generate R image `labkey/rsandbox:latest`.
Run `make rsandbox` from `images/labkey/` to generate R image `labkey/rsandbox:latest`.

Note that actual R version might differ based on latest R version at the time the image is built.
Note that actual R version might differ based on latest R version at the time the image is built.

To tag the image with the actual R version at the time of build, change `latest` in `make` file to the latest R version, for example: `3.5.1`.
To tag the image with the actual R version at the time of build, pass `R_VERSION`, for example: `make rsandbox R_VERSION=4.6.1`.

For more information, see:

Expand Down
6 changes: 0 additions & 6 deletions images/labkey/rsandbox/make

This file was deleted.

1 change: 0 additions & 1 deletion images/labkey/rsandbox/make.bat

This file was deleted.

19 changes: 9 additions & 10 deletions images/labkey/rstudio-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
ARG VERSION=4.0.5
ARG VERSION=latest
FROM rocker/rstudio:${VERSION}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils && \
apt-get install -y --no-install-recommends dos2unix nano procps libxml2-dev xvfb zlib1g-dev && \
apt-get install -y --no-install-recommends nano procps libxml2-dev xvfb zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY conf /etc/cont-init.d/
RUN dos2unix /etc/cont-init.d/conf
COPY files/conf /etc/cont-init.d/

COPY install.R /
COPY files/install.R /
RUN R --no-site-file -f install.R && \
chmod -R 755 /usr/local/lib/R/library && \
chmod -R 755 /usr/local/lib/R/site-library

COPY Rprofile.site /Rprofile.site.tmp
RUN dos2unix /Rprofile.site.tmp && \
cat /Rprofile.site.tmp >> /usr/local/lib/R/etc/Rprofile.site && \
COPY files/Rprofile.site /Rprofile.site.tmp
RUN cat /Rprofile.site.tmp >> /usr/local/lib/R/etc/Rprofile.site && \
rm /Rprofile.site.tmp
RUN echo "R_LIBS_USER=~/R/$(R --version | grep -Eo '[0-9]+[.]+[0-9]+')/library" >> /usr/local/lib/R/etc/Renviron

COPY cleanupSessionFiles.sh /
RUN dos2unix /cleanupSessionFiles.sh
COPY files/cleanupSessionFiles.sh /
RUN chmod 755 /cleanupSessionFiles.sh
File renamed without changes.
20 changes: 0 additions & 20 deletions images/labkey/rstudio-base/init

This file was deleted.

10 changes: 0 additions & 10 deletions images/labkey/rstudio-base/make

This file was deleted.

1 change: 0 additions & 1 deletion images/labkey/rstudio-base/make.bat

This file was deleted.

2 changes: 0 additions & 2 deletions images/labkey/rstudio-base/make_clean

This file was deleted.

2 changes: 0 additions & 2 deletions images/labkey/rstudio-base/rstudio-singleuser

This file was deleted.

7 changes: 0 additions & 7 deletions images/labkey/rstudio-singleuser/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/labkey/rstudio-singleuser/make

This file was deleted.

1 change: 0 additions & 1 deletion images/labkey/rstudio-singleuser/make.bat

This file was deleted.

4 changes: 0 additions & 4 deletions images/labkey/rstudio-singleuser/rstudio-singleuser

This file was deleted.

Loading
Loading