Multi stage builds are still not allowed in official I believe.

My personal preference is to separate build and test. A suggestion could be to 
include a test script in the official image, so folks could invoke a self-test 
right after build:

docker run --rm mysolr:mytag selftest.sh

Jan

> 13. okt. 2021 kl. 19:37 skrev Mike Drob <[email protected]>:
> 
> I've seen some other docker images have a test stage built into the 
> dockerfile, which makes some sense to me. We could potentially use this in 
> our builds to add a light-weight validation to the images we produce, I'm not 
> intending to replace the full suite we have under testDocker -- maybe that 
> comes later, but I think that the two test models may be complementary.
> 
> To illustrate, the dockerfile would be modified to look something like:
> 
> FROM base as build
> # Assemble image as normal
> ADD ...
> RUN ... 
> 
> FROM build as test
> RUN ./self-test.sh # Or whatever other tests we want
> 
> FROM build as final
> 
> 
> Do we know if this would be allowed for our official dockerfiles and images? 
> I remember hearing that multi-stage builds were frowned upon before, but I 
> don't know the current state of the community right now.
> 
> Are there other concerns with doing things this way?
> 
> Thanks,
> Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to