factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
918 stars 218 forks source link

Include templating support #382

Closed StopMotionCuber closed 3 years ago

StopMotionCuber commented 3 years ago

This PR includes support for templating. This means it can build different versions of the image with the same file, which can be configured via buildinfo.json.

Note that it is still missing logic to push tags, as well as the adaption of the watchdog.

Fank commented 3 years ago

I will take care about the watchdog, if this got merged

StopMotionCuber commented 3 years ago

I will take care about the watchdog, if this got merged

It would be really great if you could take care of that, I'm not really proficient in Go and my PR would likely get ugly. However, from my point of view both repos are tightly coupled and merging this PR would break the watchdog, which is why I would like to ask you to start working on the watchdog before this gets merged.

Furthermore these were the requirements I had in mind for the watchdog:

It would be great if you take these into account. Please tag me when you are finished, I'll happily review your PR.

StopMotionCuber commented 3 years ago

Should be ready now. Tell me if you want to have some squashed commits as my history is a bit messy.

SuperSandro2000 commented 3 years ago

I just squash it when the updater part is cleared.

perobertson commented 3 years ago

Was there a reason why jinja2 templating was used to generate a Dockerfile with the sha1 and version added in? From what I can tell it would keep the layer caching for all the previously published images. If that is not a concern, then docker build-args could be used instead to populate the env variables:

ARG VERSION
ENV VERSION=${VERSION}

This would result in the jinja code not being needed.

Fank commented 3 years ago

I see, i think i missed that, could you try to generate the image by using build-args?

StopMotionCuber commented 3 years ago

The reason is mostly that templating was the easiest solution that came to my mind for solving that mess we had before. Docker build-args also work and seem like the cleaner solution here, so feel free to go for it :+1: