Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Docker without R #102

Open
stephenturner opened this issue Nov 13, 2023 · 1 comment
Open

Build Docker without R #102

stephenturner opened this issue Nov 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@stephenturner
Copy link
Contributor

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.

@stephenturner
Copy link
Contributor Author

(That dependencies=FALSE is something from one of my own builds -- you may want to remove this, but needs some experimentation with deps of deps, etc)

@vpnagraj vpnagraj added the enhancement New feature or request label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants