I would like to chain Dockerfiles without using a registry, is this possible with the FROM
statement?
For example, take two Dockerfiles:
Dockerfile
/some/other/dir/Dockerfile
How could the first Dockerfile chain from the second?
FROM /some/other/dir/Dockerfile
(the above is invalid but what I would like to do)
You can chain the FROM
directive, not directly, but by creating different images that contain the other one, like russian dolls.
Have a look at the Wordpress docker image at
https://hub.docker.com/_/wordpress/
If I look at one of the Dockerfiles, at
https://github.com/docker-library/wordpress/blob/b807f1285869a220a5f72b935901603e5bde8822/php5.6/apache/Dockerfile
I see
FROM php:5.6-apache
then again
if I look at
https://github.com/docker-library/php/blob/e573f8f7fda5d7378bae9c6a936a298b850c4076/5.6/apache/Dockerfile
I see
FROM debian:jessie
of course, you will have to create an image, then docker commit myimage1
see the doc
https://docs.docker.com/engine/reference/commandline/commit/
and then you can have a Dockerfile that begins with
FROM myimage1
and so on several times
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With