Skip to content
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
2 changes: 1 addition & 1 deletion 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.4.9000
Version: 0.2.5
Authors@R: c(
person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-7343-1846")),
Expand Down
9 changes: 6 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# dockerfiler 0.2.4.9xxx
# dockerfiler 0.2.5

- feat: allow multistage dockerfile creation
- feat: COPY function can now specify a stage to copy from.
- feat: add dedicated cache for `renv::restore`
- feat: add COMMENT function to add comment in Dockerfile thanks to @jcrodriguez1989

- allow multistage dockerfile creation
- add dedicated cache for `renv::restore`

# dockerfiler 0.2.4

Expand Down
1 change: 0 additions & 1 deletion R/dock_from_renv.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# WARNING - Generated by {fusen} from dev/flat_dock_from_renv.Rmd: do not edit by hand

#' @importFrom memoise memoise
#' @noRd
Expand Down
1 change: 0 additions & 1 deletion R/gen_base_image.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# WARNING - Generated by {fusen} from dev/flat_dock_from_renv.Rmd: do not edit by hand

#' Generate base image name
#'
Expand Down
31 changes: 25 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ You're reading the doc about version :
desc::desc_get_version()
```

The check results are:

```{r eval = TRUE}
devtools::check(quiet = TRUE)
```

## Installation

You can install dockerfiler from GitHub with:
Expand Down Expand Up @@ -135,6 +129,31 @@ Save your Dockerfile:
my_dock$write()
```


## Multi-stage dockerfile

Here is an example of generating a multi-stage Dockerfile directly from R: we create two Dockerfile objects, one for the build stage (builder) and one for the final stage (final), and then merge them into a single file.

```{r}
stage_1 <- Dockerfile$new(
FROM = "alpine",AS ="builder"
)
stage_1$RUN('echo "Hi from builder" > /coucou.txt')

stage_2 <- Dockerfile$new(
FROM = "ubuntu", AS = "final"
)
stage_2$COMMENT("copy /coucou.txt from builder to /truc.txt in final")
stage_2$COPY(from = "/coucou",to = "/truc.txt",force = TRUE, stage ="builder")
stage_2$RUN( "cat /truc.txt")

stage_1$write()
stage_2$write(append = TRUE)
#file.edit("Dockerfile")
```



## Create a Dockerfile from a DESCRIPTION

You can use a DESCRIPTION file to create a Dockerfile that installs the dependencies and the package.
Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

<!-- badges: start -->

[![R-CMD-check](https://github.com/ThinkR-open/dockerfiler/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/dockerfiler/actions)
Expand All @@ -18,18 +19,7 @@ You’re reading the doc about version :

``` r
desc::desc_get_version()
#> [1] '0.2.3'
```

The check results are:

``` r
devtools::check(quiet = TRUE)
#> ℹ Loading dockerfiler
#> ── R CMD check results ────────────────────────────────── dockerfiler 0.2.3 ────
#> Duration: 1m 31.3s
#>
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
#> [1] '0.2.5'
```

## Installation
Expand Down Expand Up @@ -131,6 +121,31 @@ Save your Dockerfile:
my_dock$write()
```

## Multi-stage dockerfile

Here is an example of generating a multi-stage Dockerfile directly from
R: we create two Dockerfile objects, one for the build stage (builder)
and one for the final stage (final), and then merge them into a single
file.

``` r
stage_1 <- Dockerfile$new(
FROM = "alpine",AS ="builder"
)
stage_1$RUN('echo "Hi from builder" > /coucou.txt')

stage_2 <- Dockerfile$new(
FROM = "ubuntu", AS = "final"
)
stage_2$COMMENT("copy /coucou.txt from builder to /truc.txt in final")
stage_2$COPY(from = "/coucou",to = "/truc.txt",force = TRUE, stage ="builder")
stage_2$RUN( "cat /truc.txt")

stage_1$write()
stage_2$write(append = TRUE)
#file.edit("Dockerfile")
```

## Create a Dockerfile from a DESCRIPTION

You can use a DESCRIPTION file to create a Dockerfile that installs the
Expand Down
16 changes: 0 additions & 16 deletions dev/config_fusen.yaml

This file was deleted.

Loading
Loading