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

Dev tmp #72

Merged
merged 5 commits into from
Jun 30, 2024
Merged
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
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dockerfiler
Title: Easy Dockerfile Creation from R
Version: 0.2.2.9002
Version: 0.2.2.9003
Authors@R: c(
person("Colin", "Fay", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-7343-1846")),
Expand Down Expand Up @@ -38,9 +38,8 @@ Suggests:
rmarkdown (>= 2.6),
testthat (>= 3.0.0),
withr
VignetteBuilder:
knitr
Config/fusen/version: 0.5.2
VignetteBuilder: knitr
Config/fusen/version: 0.6.0
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- remove sysreqs.r-hub.io to use {pak} instead for system requirement detection
- move from `pak::pkg_system_requirements` to `pak::pkg_sysreqs()` thanks to @B0ydT

- `dock_from_renv` allow to specify user to use in Dockerfile

# dockerfile 0.2.2

Expand Down
6 changes: 5 additions & 1 deletion R/dock_from_renv.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pkg_sysreqs_mem <- memoise::memoise(
#' specifically `r dockerfiler::renv$initialize();toString(dockerfiler::renv$the$metadata$version)`, will be used.
#' If you set it to `NULL`, the latest available version of renv will be used.
#' @param use_pak boolean. If `TRUE` use pak to deal with dependencies during `renv::restore()`. FALSE by default
#' @param user Name of the user to specify in the Dockerfile with the USER instruction. Default is `NULL`, in which case the user from the FROM image is used.
#' @importFrom utils getFromNamespace
#' @return A R6 object of class `Dockerfile`.
#' @details
Expand Down Expand Up @@ -66,6 +67,7 @@ dock_from_renv <- function(
expand = FALSE,
extra_sysreqs = NULL,
use_pak = FALSE,
user = NULL,
renv_version
) {
distro <- match.arg(distro, available_distros)
Expand All @@ -83,7 +85,9 @@ dock_from_renv <- function(
),
AS = AS
)

if (!is.null(user)) {
dock$USER(user)
}
# get renv version

if (missing(renv_version)) {
Expand Down
12 changes: 12 additions & 0 deletions dev/config_attachment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
path.n: NAMESPACE
path.d: DESCRIPTION
dir.r: R
dir.v: vignettes
dir.t: tests
extra.suggests: ~
pkg_ignore: ~
document: yes
normalize: yes
inside_rmd: no
must.exist: yes
check_if_suggests_is_installed: yes
1 change: 1 addition & 0 deletions dev/config_fusen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ flat_dock_from_renv.Rmd:
check: false
document: false
overwrite: 'yes'
clean: ask
6 changes: 5 additions & 1 deletion dev/flat_dock_from_renv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pkg_sysreqs_mem <- memoise::memoise(
#' specifically `r dockerfiler::renv$initialize();toString(dockerfiler::renv$the$metadata$version)`, will be used.
#' If you set it to `NULL`, the latest available version of renv will be used.
#' @param use_pak boolean. If `TRUE` use pak to deal with dependencies during `renv::restore()`. FALSE by default
#' @param user Name of the user to specify in the Dockerfile with the USER instruction. Default is `NULL`, in which case the user from the FROM image is used.
#' @importFrom utils getFromNamespace
#' @return A R6 object of class `Dockerfile`.
#' @details
Expand Down Expand Up @@ -104,6 +105,7 @@ dock_from_renv <- function(
expand = FALSE,
extra_sysreqs = NULL,
use_pak = FALSE,
user = NULL,
renv_version
) {
distro <- match.arg(distro, available_distros)
Expand All @@ -121,7 +123,9 @@ dock_from_renv <- function(
),
AS = AS
)

if (!is.null(user)) {
dock$USER(user)
}
# get renv version

if (missing(renv_version)) {
Expand Down
3 changes: 3 additions & 0 deletions man/dock_from_renv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions vignettes/dockerfile-from-renv-lock.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Dockerfile from renv.lock"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{dockerfile-from-renv-lock}
%\VignetteIndexEntry{Dockerfile from renv.lock}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -14,32 +14,28 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(dockerfiler)
```

<!-- WARNING - This vignette is generated by {fusen} from dev/flat_dock_from_renv.Rmd: do not edit by hand -->



<!--
You need to run the 'description' chunk in the '0-dev_history.Rmd' file before continuing your code there.
-->


# gen_base_image








# Create a Dockerfile from a renv.lock file





```{r example-dock_from_renv}
#' \dontrun{
#' dock <- dock_from_renv("renv.lock", distro = "xenial")
Expand All @@ -50,3 +46,4 @@ library(dockerfiler)




Loading