TheRacetrack / racetrack

An opinionated framework for deploying, managing, and serving application workloads
https://theracetrack.github.io/racetrack/
Apache License 2.0
28 stars 5 forks source link

Merge base Dockerfile with job template #404

Closed iszulcdeepsense closed 5 months ago

iszulcdeepsense commented 5 months ago

To build a job image, Racetrack does it in two steps with 2 different files which seems to be convoluted. That's because 2 docker build steps have different Docker build contexts:

  1. base image, built from base.Dockerfile provided by job type plugin. Plugin directory is a build context in this step to provide the source code of a job type wrapper into the image.
  2. job template, built from job-template.Dockerfile and a manifest (that allows to parametrize it with user-defined configuration). User's job directory is a build context in this case to provide the source code of a job to the image.

Recently, docker introduced Multiple build contexts (see Additional build contexts) that allows to simplify this process and merge it into one Dockerfile, providing 2 build context to one building process.

That would also make the building process more flexible. For instance, allowing to:

Changelog

Changed