Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bergkvist/includeimage
Dockerfile syntax extension for combining multiple Docker images into one. (INCLUDE <image>)
https://github.com/bergkvist/includeimage
buildkit docker-build docker-image dockerfile golang include syntax
Last synced: 3 months ago
JSON representation
Dockerfile syntax extension for combining multiple Docker images into one. (INCLUDE <image>)
- Host: GitHub
- URL: https://github.com/bergkvist/includeimage
- Owner: bergkvist
- License: apache-2.0
- Created: 2020-06-22T01:14:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-25T09:35:19.000Z (over 4 years ago)
- Last Synced: 2024-06-22T21:12:16.188Z (5 months ago)
- Topics: buildkit, docker-build, docker-image, dockerfile, golang, include, syntax
- Language: Go
- Homepage: https://github.com/moby/moby/issues/3378
- Size: 15.6 KB
- Stars: 21
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - bergkvist/includeimage - Dockerfile syntax extension for combining multiple Docker images into one. (INCLUDE <image>) (Go)
README
See https://github.com/moby/moby/issues/3378
# bergkvist/includeimage
Dockerfile syntax extension for combining multiple Docker images into one.
## Usage
### Syntax
```
INCLUDE :
```### Example
```Dockerfile
#syntax=bergkvist/includeimage
FROM alpine:3.12.0
INCLUDE rust:1.44-alpine3.12
INCLUDE python:3.8.3-alpine3.12
```### How to build
Remember to use Docker buildkit when building, as seen below.
```sh
DOCKER_BUILDKIT=1 docker build -t myimage:latest .
```## Behavior
- The entire file system of an included image is copied over
- The environment variables of the included image is merged in
- PATH gets special treatment
- CMD and ENTRYPOINT of included image is ignored.How it is implemented:
```Dockerfile
# All the file system contents are copied over (using multi-stage builds)
COPY --from=: / /
# We extract the environment variables from the included image
ENV <-(merge)- docker inspect : --format='{{.Config.Env}}'
```## Current Issues/Limitations
- Currently only supports including amd64 linux images.
- The PATH variable will eventually contain a lot of duplicate entries. This could probably be cleaned up, but shouldn't cause any issues. (I think)