Skip to content

Conversation

@VincentGuyader
Copy link
Member

fix #83
this is the main modification :

stage_1 <- Dockerfile$new(
  FROM = "alpine",AS ="builder"
)
stage_1$RUN('echo "coucou depuis le builder" > /coucou')

stage_2 <- Dockerfile$new(
  FROM = "ubuntu"
)
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)

output :


FROM alpine AS builder
RUN echo "coucou depuis le builder" > /coucou

FROM ubuntu
COPY --from=builder /coucou /truc.txt
RUN cat /truc.txt

I avoided introducing breaking changes — though the temptation was strong to rename the from parameter to FROM (instead of using stage), and to use source and destination instead of from and to. The same goes for the as argument in write(), which could be problematic and would ideally be renamed to path.

The underlying idea is to keep all uppercase parameters aligned with those expected in the Dockerfile, in a consistent and homogeneous way.

@VincentGuyader VincentGuyader requested a review from ColinFay April 10, 2025 17:48
@VincentGuyader VincentGuyader merged commit a2bf4f6 into master Apr 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow multistage docker creation

2 participants