INNER CODE UNIT · Go
func
runmedev/runme · .dagger/main.go:75
func (m *Runme) TargetPlatform(ctx context.Context) string {
return fmt.Sprintf("%s/%s", m.TargetOS, m.TargetArch)
}
// BaseImage is the base image for the Runme build environment.
func (m *Runme) Base(ctx context.Context) *dagger.Container {
// archs have to match for app-level unit tests to pass
containerPlatform := dagger.Platform(fmt.Sprintf("linux/%s", m.TargetArch))
ctr := dag.Container(dagger.ContainerOpts{Platform: containerPlatform}).
From("ghcr.io/runmedev/runme-build-env:latest").
WithWorkdir("/workspace")
if m.GhcrToken != nil {
ctr = ctr.WithRegistryAuth("ghcr.io", m.GhcrUsername, m.GhcrToken)
}
return ctr
}