Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Earthly is a tool that allows you to create reliable build systems. It is kind of like a mix of GNUmakefiles and Docker and prides itself as being write once, build everywhere. Earthly can also import Dockerfiles and you can depend on other Earthfiles.
By adding an Earthfile that depends on the Dockerfile, you allow downstream users to import it and follow updates to the Dockerfile without manual intervention required. Like in Github Actions, you can follow branches, tags or commits too.
I use xwin for years now already and, so far, kept my Earthly-based repositories manually up-to-date. I would be very happy if I could automatically update in the future.
Technical Details
Earthly is very similar to docker buildx and buildkit based. The
.earthlyignore
file uses the same syntax as dockerignore and gitignore and is there to reduce the scope of the build context.The
Earthfile
can be anywhere inside the repository, as long as thexwin.dockerfile
is located in the same or a subdirectory of the Earthfile. The build context will always be the same directory as theEarthfile
and is only affected by the.earthlyignore
located in the same directory as theEarthfile
.So it would be possible to create for example a
docker
folder inside the repository, put theEarthfile
andxwin.dockerfile
files inside it, and remove the.earthlyignore
. That would be equivalent to the way I structured this PR.