Skip to content

Build Docker without R #102

@stephenturner

Description

@stephenturner

Opening this but feel free to close @vpnagraj.

Building a Docker image from a Dockerfile created with pracac requires R to be installed on the host system. This may not always be desirable, in the case where you'd like to distribute the source code to others to build who may not have R installed for building the package targz.

An alternative approach could copy relevant R package source folders into the container and use devtools to build:

# FROM whatever
# RUN Rscript -e install deps, etc.

# Install devtools: not a pkg dep, but needed to install in the docker build
RUN Rscript -e 'BiocManager::install(c("devtools"))'

# Copy the source into the root of the container
RUN mkdir -p /src
COPY DESCRIPTION NAMESPACE .Rbuildignore /src
COPY R /src/R
COPY man /src/man
COPY inst /src/inst
COPY data /src/data
COPY vignettes /src/vignettes

# Build the R package
RUN Rscript -e 'devtools::install("/src", dependencies=FALSE)'

# Continue COPYing and add ENTRYPOINT, etc.

I'm okay closing this issue as well -- pracpac is meant to be used by package developers, who in every case will have R installed on their system. The thought here is for downstream consumers who may not, who'd like to build the image without a pre-build source tar.gz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions