Dockerfile syntax extension for combining multiple Docker images into one. (INCLUDE <image>)
817
See https://github.com/moby/moby/issues/3378
Dockerfile syntax extension for combining multiple Docker images into one.
INCLUDE <image>:<tag>
#syntax=bergkvist/includeimage
FROM alpine:3.12.0
INCLUDE rust:1.44-alpine3.12
INCLUDE python:3.8.3-alpine3.12
Remember to use Docker buildkit when building, as seen below.
DOCKER_BUILDKIT=1 docker build -t myimage:latest .
How it is implemented:
# All the file system contents are copied over (using multi-stage builds)
COPY --from=<image>:<tag> / /
# We extract the environment variables from the included image
ENV <-(merge)- docker inspect <image>:<tag> --format='{{.Config.Env}}'
Content type
Image
Digest
Size
11.3 MB
Last updated
over 6 years ago
docker pull bergkvist/includeimage