targets

package
v0.0.0-...-c0f930a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoRepo = "mcr.microsoft.com/oss/go/microsoft/golang"
)
View Source
const Mariner2Ref = "mcr.microsoft.com/cbl-mariner/base/core:2.0"

Variables

View Source
var (
	BionicRef            = path.Join(MirrorPrefix(), "buildpack-deps:bionic")
	BionicAptCacheKey    = "bionic-apt-cache"
	BionicAptLibCacheKey = "bionic-apt-lib-cache"
)
View Source
var (
	BookwormRef            = path.Join(MirrorPrefix(), "buildpack-deps:bookworm")
	BookwormAptCacheKey    = "bookworm-apt-cache"
	BookwormAptLibCacheKey = "bookworm-apt-lib-cache"
)
View Source
var (
	BullseyeRef            = path.Join(MirrorPrefix(), "buildpack-deps:bullseye")
	BullseyeAptCacheKey    = "bullseye-apt-cache"
	BullseyeAptLibCacheKey = "bullseye-apt-lib-cache"
)
View Source
var (
	BusterRef            = path.Join(MirrorPrefix(), "buildpack-deps:buster")
	BusterAptCacheKey    = "buster-apt-cache"
	BusterAptLibCacheKey = "buster-apt-lib-cache"
)
View Source
var (
	FocalRef            = path.Join(MirrorPrefix(), "buildpack-deps:focal")
	FocalAptCacheKey    = "focal-apt-cache"
	FocalAptLibCacheKey = "focal-apt-lib-cache"
)
View Source
var (
	JammyRef            = path.Join(MirrorPrefix(), "buildpack-deps:jammy")
	JammyAptCacheKey    = "jammy-apt-cache"
	JammyAptLibCacheKey = "jammy-apt-lib-cache"
)
View Source
var (
	NobleRef            = path.Join(MirrorPrefix(), "buildpack-deps:noble")
	NobleAptCacheKey    = "noble-apt-cache"
	NobleAptLibCacheKey = "noble-apt-lib-cache"
)
View Source
var (
	BaseWinPackages = []string{
		"binutils-mingw-w64",
		"g++-mingw-w64-x86-64",
		"gcc",
		"git",
		"make",
		"pkg-config",
		"quilt",
		"zip",
	}

	BaseDebPackages = []string{
		"build-essential",
		"cmake",
		"dh-make",
		"devscripts",
		"dh-apparmor",
		"dpkg-dev",
		"equivs",
		"fakeroot",
		"libbtrfs-dev",
		"libdevmapper-dev",
		"libltdl-dev",
		"libseccomp-dev",
		"quilt",
	}

	BaseBionicPackages = []string{
		"bash",
		"build-essential",
		"cmake",
		"dh-make",
		"devscripts",
		"dh-apparmor",
		"dpkg-dev",
		"equivs",
		"fakeroot",
		"libdevmapper-dev",
		"libltdl-dev",
		"libseccomp-dev",
		"quilt",
	}

	BaseMarinerPackages = []string{
		"bash",
		"binutils",
		"build-essential",
		"ca-certificates",
		"cmake",
		"device-mapper-devel",
		"diffutils",
		"dnf-utils",
		"file",
		"gcc",
		"git",
		"glibc-static",
		"libffi-devel",
		"libseccomp-devel",
		"libtool",
		"libtool-ltdl-devel",
		"make",
		"patch",
		"pkgconfig",
		"pkgconfig(systemd)",
		"rpm-build",
		"rpmdevtools",
		"selinux-policy-devel",
		"systemd-devel",
		"tar",
		"which",
		"yum-utils",
	}

	BaseRPMPackages = []string{
		"bash",
		"ca-certificates",
		"cmake",
		"device-mapper-devel",
		"gcc",
		"git",
		"glibc-static",
		"libseccomp-devel",
		"libtool",
		"libtool-ltdl-devel",
		"make",
		"make",
		"patch",
		"pkgconfig",
		"pkgconfig(systemd)",
		"rpmdevtools",
		"selinux-policy-devel",
		"systemd-devel",
		"tar",
		"which",
		"yum-utils",
	}

	GetGoVersionForPackage = map[string]GoVersionFunc{
		"moby-buildx":                  buildx.GoVersion,
		"moby-cli":                     cli.GoVersion,
		"moby-compose":                 compose.GoVersion,
		"moby-containerd":              containerd.GoVersion,
		"moby-containerd-shim-systemd": shim.GoVersion,
		"moby-engine":                  engine.GoVersion,
		"moby-runc":                    runc.GoVersion,
		"moby-tini":                    tini.GoVersion,
	}
)
View Source
var (
	Centos7Ref = path.Join(MirrorPrefix(), "centos:7")
)
View Source
var (
	GoModCacheKey = "go-mod-cache"
)
View Source
var (
	Rhel8Ref = path.Join(MirrorPrefix(), "almalinux:8")
)
View Source
var (
	Rhel9Ref = path.Join(MirrorPrefix(), "almalinux:9")
)
View Source
var (
	WindowsRef = path.Join(MirrorPrefix(), "buildpack-deps:bullseye")
)

Functions

func FetchRef

func FetchRef(client *dagger.Client, repo, commit string) *dagger.GitRef

func InstallGo

func InstallGo(ctx context.Context, c *dagger.Container, modCache, buildCache *dagger.CacheVolume, goVersion string) (*dagger.Container, error)

func MirrorPrefix

func MirrorPrefix() string

func WithPlatformEnvs

func WithPlatformEnvs(c *dagger.Container, build, target dagger.Platform) *dagger.Container

func YumInstall

func YumInstall(c *dagger.Container, pkgs ...string) *dagger.Container

Types

type GoVersionFunc

type GoVersionFunc = func(*archive.Spec) string

type MakeTargetFunc

type MakeTargetFunc func(context.Context, *dagger.Client, dagger.Platform, string) (*Target, error)

type Packager

type Packager interface {
	Package(*dagger.Client, *dagger.Container, *archive.Spec) *dagger.Directory
}

type Target

type Target struct {
	// contains filtered or unexported fields
}

func Bionic

func Bionic(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Bookworm

func Bookworm(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Bullseye

func Bullseye(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Buster

func Buster(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Centos7

func Centos7(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Focal

func Focal(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func GetTarget

func GetTarget(ctx context.Context, distro string, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Jammy

func Jammy(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Mariner2

func Mariner2(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Noble

func Noble(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Rhel8

func Rhel8(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Rhel9

func Rhel9(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func Windows

func Windows(ctx context.Context, client *dagger.Client, platform dagger.Platform, goVersion string) (*Target, error)

func (*Target) AptInstall

func (t *Target) AptInstall(pkgs ...string) *Target

func (*Target) Container

func (t *Target) Container() *dagger.Container

func (*Target) InstallGo

func (t *Target) InstallGo(ctx context.Context, goVersion string) (*Target, error)

func (*Target) Make

func (t *Target) Make(project *archive.Spec, projectDir, hackCrossDir *dagger.Directory) (*dagger.Directory, error)

func (*Target) Packager

func (t *Target) Packager(projectName, distro, version string) (Packager, error)

func (*Target) PkgKind

func (t *Target) PkgKind() string

func (*Target) Winres

func (t *Target) Winres() *dagger.File

Winres is used during windows builds (as part of the project build scripts) to "manifest" binaries. This is required for windows to properly identify the binaries.

func (*Target) WithExec

func (t *Target) WithExec(args []string, opts ...dagger.ContainerWithExecOpts) *Target

func (*Target) WithPlatformEnvs

func (t *Target) WithPlatformEnvs() *Target

Jump to

Keyboard shortcuts

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