testimage

package
v0.30.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testimage gives a test that builds a ShellHub Dockerfile the build arguments the Dockerfile declares without defaults: the versions pinned in versions.env at the repository root, the same file the compose wrapper and CI pass to their builds.

Index

Constants

View Source
const FileName = "versions.env"

FileName is the file at the repository root that pins every build-time version.

View Source
const MirrorEnv = "DOCKERHUB_MIRROR"

MirrorEnv names the environment variable holding the registry prefix Docker Hub images are pulled through, such as "registry.infra.ossystems.io/cache/". Empty pulls from Docker Hub.

Variables

This section is empty.

Functions

func BuildArgs

func BuildArgs(root string) (map[string]*string, error)

BuildArgs reads versions.env from root and returns its KEY=VALUE lines in the form testcontainers takes as build arguments, with MirrorEnv added from the environment. It returns an error when the file cannot be read or a line is not KEY=VALUE with both sides filled in, so a build never runs with an empty version.

func DockerHub added in v0.28.0

func DockerHub(image string) string

DockerHub returns image, a Docker Hub reference such as "alpine:3.24.2", behind the prefix Mirror returns, or image itself when MirrorEnv is unset.

func Mirror added in v0.28.0

func Mirror() string

Mirror returns the registry prefix MirrorEnv holds, empty when the variable is unset.

func Root

func Root() (string, error)

Root returns the repository root: the nearest directory at or above the working directory that holds versions.env. It returns an error when the working directory cannot be resolved or no directory above it holds the file, so a test never reads a version from the wrong checkout.

func Version

func Version(root, key string) (string, error)

Version returns the value versions.env under root pins for key. It returns an error when the file cannot be read, has a line that is not KEY=VALUE or has no such key, so a caller never runs a tool at an unpinned version.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL