Skip to content

Commit db5ddac

Browse files
RC 0.2.5 (#86)
1 parent ccb6869 commit db5ddac

File tree

11 files changed

+66
-564
lines changed

11 files changed

+66
-564
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dockerfiler
22
Title: Easy Dockerfile Creation from R
3-
Version: 0.2.4.9000
3+
Version: 0.2.5
44
Authors@R: c(
55
person("Colin", "Fay", , "[email protected]", role = c("cre", "aut"),
66
comment = c(ORCID = "0000-0001-7343-1846")),

NEWS.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# dockerfiler 0.2.4.9xxx
1+
# dockerfiler 0.2.5
2+
3+
- feat: allow multistage dockerfile creation
4+
- feat: COPY function can now specify a stage to copy from.
5+
- feat: add dedicated cache for `renv::restore`
6+
- feat: add COMMENT function to add comment in Dockerfile thanks to @jcrodriguez1989
27

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

69
# dockerfiler 0.2.4
710

R/dock_from_renv.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# WARNING - Generated by {fusen} from dev/flat_dock_from_renv.Rmd: do not edit by hand
21

32
#' @importFrom memoise memoise
43
#' @noRd

R/gen_base_image.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# WARNING - Generated by {fusen} from dev/flat_dock_from_renv.Rmd: do not edit by hand
21

32
#' Generate base image name
43
#'

README.Rmd

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ You're reading the doc about version :
3232
desc::desc_get_version()
3333
```
3434

35-
The check results are:
36-
37-
```{r eval = TRUE}
38-
devtools::check(quiet = TRUE)
39-
```
40-
4135
## Installation
4236

4337
You can install dockerfiler from GitHub with:
@@ -135,6 +129,31 @@ Save your Dockerfile:
135129
my_dock$write()
136130
```
137131

132+
133+
## Multi-stage dockerfile
134+
135+
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.
136+
137+
```{r}
138+
stage_1 <- Dockerfile$new(
139+
FROM = "alpine",AS ="builder"
140+
)
141+
stage_1$RUN('echo "Hi from builder" > /coucou.txt')
142+
143+
stage_2 <- Dockerfile$new(
144+
FROM = "ubuntu", AS = "final"
145+
)
146+
stage_2$COMMENT("copy /coucou.txt from builder to /truc.txt in final")
147+
stage_2$COPY(from = "/coucou",to = "/truc.txt",force = TRUE, stage ="builder")
148+
stage_2$RUN( "cat /truc.txt")
149+
150+
stage_1$write()
151+
stage_2$write(append = TRUE)
152+
#file.edit("Dockerfile")
153+
```
154+
155+
156+
138157
## Create a Dockerfile from a DESCRIPTION
139158

140159
You can use a DESCRIPTION file to create a Dockerfile that installs the dependencies and the package.

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
3+
34
<!-- badges: start -->
45

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

1920
``` r
2021
desc::desc_get_version()
21-
#> [1] '0.2.3'
22-
```
23-
24-
The check results are:
25-
26-
``` r
27-
devtools::check(quiet = TRUE)
28-
#> ℹ Loading dockerfiler
29-
#> ── R CMD check results ────────────────────────────────── dockerfiler 0.2.3 ────
30-
#> Duration: 1m 31.3s
31-
#>
32-
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
22+
#> [1] '0.2.5'
3323
```
3424

3525
## Installation
@@ -131,6 +121,31 @@ Save your Dockerfile:
131121
my_dock$write()
132122
```
133123

124+
## Multi-stage dockerfile
125+
126+
Here is an example of generating a multi-stage Dockerfile directly from
127+
R: we create two Dockerfile objects, one for the build stage (builder)
128+
and one for the final stage (final), and then merge them into a single
129+
file.
130+
131+
``` r
132+
stage_1 <- Dockerfile$new(
133+
FROM = "alpine",AS ="builder"
134+
)
135+
stage_1$RUN('echo "Hi from builder" > /coucou.txt')
136+
137+
stage_2 <- Dockerfile$new(
138+
FROM = "ubuntu", AS = "final"
139+
)
140+
stage_2$COMMENT("copy /coucou.txt from builder to /truc.txt in final")
141+
stage_2$COPY(from = "/coucou",to = "/truc.txt",force = TRUE, stage ="builder")
142+
stage_2$RUN( "cat /truc.txt")
143+
144+
stage_1$write()
145+
stage_2$write(append = TRUE)
146+
#file.edit("Dockerfile")
147+
```
148+
134149
## Create a Dockerfile from a DESCRIPTION
135150

136151
You can use a DESCRIPTION file to create a Dockerfile that installs the

dev/config_fusen.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)