Problem
Users cannot choose the base image used for the Go environment.
The module always builds Go containers from golang:<version>-alpine. That works for the default case, but some users need their own Go image with things like internal CA certificates, proxy setup, pinned digests, security patches, or preinstalled tools.
Right now they cannot do that without changing the module.
Solution
Add a top-level constructor setting named baseImage with type Container.
By default, it should keep the current behavior and use:
container.from("golang:" + version + "-alpine")
When a user passes a custom container, the module should use that container for the Go environment instead.
This should apply to the Go test/generate containers and the helper containers that currently use the hard-coded Go image.
Update the e2e tests to cover the new setting.
Run tests with:
dagger check -m .dagger/modules/e2e
Problem
Users cannot choose the base image used for the Go environment.
The module always builds Go containers from
golang:<version>-alpine. That works for the default case, but some users need their own Go image with things like internal CA certificates, proxy setup, pinned digests, security patches, or preinstalled tools.Right now they cannot do that without changing the module.
Solution
Add a top-level constructor setting named
baseImagewith typeContainer.By default, it should keep the current behavior and use:
container.from("golang:" + version + "-alpine")When a user passes a custom container, the module should use that container for the Go environment instead.
This should apply to the Go test/generate containers and the helper containers that currently use the hard-coded Go image.
Update the e2e tests to cover the new setting.
Run tests with:
dagger check -m .dagger/modules/e2e