Sign inSign up

shinsenter/dockerfile-x

Sponsored OSS

By SHIN Company

Updated 3 months ago

A project that extends the standard Dockerfile syntax, developed by "devthefuture".

Image
Developer tools
1

10K+

shinsenter/dockerfile-x repository overview

Dockerfile-x

"Dockerfile-x" primarily refers to the devthefuture/dockerfile-x project.

This "Dockerfile-x" project introduces an extended syntax for Dockerfiles, aiming to improve modularity and reduce code duplication through features like an INCLUDE directive for external file fragments and relative paths for FROM instructions.


NOTE: This is just a copy of the original repository, used to reduce errors when building my other Docker images.

Examples

To enable dockerfile-x custom syntax, you can use native docker buildkit frontend feature by adding syntax comment to the beginning of your Dockerfile:

# syntax = shinsenter/dockerfile-x
FROM ./base/dockerfile
COPY --from=./build/dockerfile#build-stage /app /app
INCLUDE ./other/dockerfile

Basic INCLUDE

# syntax = shinsenter/dockerfile-x
FROM debian:latest
INCLUDE ./common-instructions.dockerfile
CMD ["bash"]

Using stages from another Dockerfile

# syntax = shinsenter/dockerfile-x
FROM ./base/dockerfile#dev AS development
FROM ./base/dockerfile#prod AS production
COPY --from=development /app /app
CMD ["start-app"]

Re-aliasing a stage

# syntax = shinsenter/dockerfile-x
FROM ./complex-setup/dockerfile#old-stage-name AS new-name
COPY ./configs /configs

Tag summary

Content type

Image

Digest

sha256:d9b177f40

Size

40.7 MB

Last updated

3 months ago

docker pull shinsenter/dockerfile-x

This week's pulls

Pulls:

7

Last week