Skip to content

Commit

Permalink
Minor fixups in ubuntu distro setup
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Goff <[email protected]>
  • Loading branch information
cpuguy83 committed Nov 15, 2024
1 parent 6e93779 commit 1bd4f19
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/deb/distro/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *Config) BuildContainer(worker llb.State, sOpt dalec.SourceOpts, client
withRepos,
llb.AddEnv("DEBIAN_FRONTEND", "noninteractive"),
dalec.WithMountedAptCache(c.AptCachePrefix),
// This file makes dpkg give more verbose output which can be useful when things go awry.
llb.AddMount("/etc/dpkg/dpkg.cfg.d/99-dalec-debug", debug, llb.SourcePath("debug"), llb.Readonly),
dalec.RunOptFunc(func(cfg *llb.ExecInfo) {
tmp := llb.Scratch().File(llb.Mkfile("tmp", 0o644, nil), opts...)
Expand Down
14 changes: 9 additions & 5 deletions frontend/deb/distro/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ import (
"github.com/pkg/errors"
)

var (
defaultRepoConfig = &dalec.RepoPlatformConfig{
ConfigRoot: "/etc/apt/sources.list.d",
GPGKeyRoot: "/usr/share/keyrings",
ConfigExt: ".list",
}
)

type Config struct {
ImageRef string
ContextRef string
Expand Down Expand Up @@ -64,11 +72,7 @@ func (cfg *Config) RepoMounts(repos []dalec.PackageRepositoryConfig, sOpt dalec.

repoConfig := cfg.RepoPlatformConfig
if repoConfig == nil {
repoConfig = &dalec.RepoPlatformConfig{
ConfigRoot: "/etc/apt/sources.list.d",
GPGKeyRoot: "/usr/share/keyrings",
ConfigExt: ".list",
}
repoConfig = defaultRepoConfig
}

withRepos, err := dalec.WithRepoConfigs(repos, repoConfig, sOpt, opts...)
Expand Down
4 changes: 2 additions & 2 deletions frontend/deb/distro/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ apt autoclean -y
apt update
if ! command -v apititude > /dev/null; then
if ! command -v aptitude > /dev/null; then
needs_cleanup=1
apt install -y aptitude
fi
Expand Down Expand Up @@ -131,7 +131,7 @@ func (d *Config) InstallBuildDeps(sOpt dalec.SourceOpts, spec *dalec.Spec, targe
}

return in.Async(func(ctx context.Context, in llb.State, c *llb.Constraints) (llb.State, error) {
opts := append(opts, dalec.ProgressGroup("Insall build dependencies"))
opts := append(opts, dalec.ProgressGroup("Install build dependencies"))
opts = append([]llb.ConstraintsOpt{dalec.WithConstraint(c)}, opts...)

srcPkg, err := deb.SourcePackage(sOpt, in, depsSpec, targetKey, "", opts...)
Expand Down

0 comments on commit 1bd4f19

Please sign in to comment.