Skip to content

Allow custom Go base image #10

@shykes

Description

@shykes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions