https://github.com/klakegg/dockerfile-import
Preprocessing of Dockerfiles containing IMPORT instructions.
https://github.com/klakegg/dockerfile-import
docker dockerfile
Last synced: 11 months ago
JSON representation
Preprocessing of Dockerfiles containing IMPORT instructions.
- Host: GitHub
- URL: https://github.com/klakegg/dockerfile-import
- Owner: klakegg
- License: mit
- Created: 2020-09-12T16:11:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T13:28:11.000Z (over 5 years ago)
- Last Synced: 2025-01-22T16:09:26.092Z (about 1 year ago)
- Topics: docker, dockerfile
- Language: Ruby
- Homepage: https://hub.docker.com/r/klakegg/dockerfile-import
- Size: 25.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dockerfile Import
Introduces the instruction `IMPORT` for preprocessing of Dockerfiles.
Syntax:
```
IMPORT [AS ]
```
Import without `name` will import the referenced file without any modifications.
Import with `name` will import the referenced file and update instances of `COPY` and `FROM` by prefixing or inserting the name when relevant.
`file` is looked up in this order:
1. `file`.df
1. `file`/Dockerfile
1. `file`
Imported files may include further import instructions relative to the imported file.
To build your image using import instructions, simply preprocess your Dockerfile before performing `docker build`:
```bash
# Preprocess dockerfile
docker run --rm -i \
-v $(pwd):/work \
-u $(id -u) \
klakegg/dockerfile-import \
Dockerfile Dockerfile-imported
# Build as usual with the preprocessed file
docker build -t mytag -f Dockerfile-imported .
```