gardenlinux / builder

Builder used to construct Garden Linux. Re-usable for other OS-projects.
Apache License 2.0
8 stars 1 forks source link

Build from 'builder.dockerfile' if exists #43

Closed fwilhe closed 9 months ago

fwilhe commented 9 months ago

This change allows to track the used Builder tag in a Dockerfile. This is useful for using Dependabot to keep the builder version up to date.

Users of the Builder who wish to use Dependabot will need to create a builder.dockerfile next to their build script with the following contents:

FROM ghcr.io/gardenlinux/builder:SHA

Where SHA will be updated by dependabot if configured correctly.

also users will need to set the container_image value in build to localhost/builder

fwilhe commented 9 months ago

I know it looks weird that I don't have quotes in $containerfile but as far as I understand word splitting is what we want here..

Vincinator commented 9 months ago

Could we add documentation? Could be a chapter in docs/getting_started.md or a new file in docs/ For example:

## Updating Builder Tag in Dockerfile with Dependabot

### Purpose
Enable Dependabot to automatically update the Builder tag in Dockerfiles.

### Steps

1. **Create `builder.dockerfile`**:
   - Place next to your `build` script.
   - Add the content: `FROM ghcr.io/gardenlinux/builder:SHA`.
   - `SHA` is the Builder version, updated by Dependabot.

2. **Configure `build` Script**:
   - Set `container_image` to `localhost/builder`.

### Dependabot Setup
Ensure Dependabot monitors `builder.dockerfile` for automatic Builder version updates.
fwilhe commented 9 months ago

Could we add documentation?

Yes. I'm not sure if we are there yet because (as far as I understand) Dependabot needs releases on github to actually detect new versions, so we will need to push releases of the builder which we don't do yet. My approach here was to implement the requirements 1 by 1 and document it once we can verify it works.

To my understanding what is missing for this is merging this PR, and push proper tags/releases in this repo which I'd to in another PR (have not yet looked into how the images are published in detail).