docker/podman: squash newly built layers into a single new layer
This commit is contained in:
parent
a0ee660e50
commit
3c8e80cace
@ -96,7 +96,7 @@ func (cmd *KernelDockerRegenCmd) Run(kernelCmd *KernelCmd, g *Globals) (err erro
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("docker", "build", "-t",
|
cmd := exec.Command("docker", "build", "--squash", "-t",
|
||||||
d.ContainerName, imagePath)
|
d.ContainerName, imagePath)
|
||||||
var rawOutput []byte
|
var rawOutput []byte
|
||||||
rawOutput, err = cmd.CombinedOutput()
|
rawOutput, err = cmd.CombinedOutput()
|
||||||
@ -346,7 +346,7 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = exec.Command("docker", "build", "-t", sk.DockerName(), imagePath)
|
cmd = exec.Command("docker", "build", "--squash", "-t", sk.DockerName(), imagePath)
|
||||||
rawOutput, err = cmd.CombinedOutput()
|
rawOutput, err = cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Base image for %s:%s generating error, see log",
|
log.Printf("Base image for %s:%s generating error, see log",
|
||||||
@ -413,7 +413,7 @@ func dockerImageAppend(sk config.KernelMask, pkgname string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("docker", "build", "-t", sk.DockerName(), imagePath)
|
cmd := exec.Command("docker", "build", "--squash", "-t", sk.DockerName(), imagePath)
|
||||||
rawOutput, err := cmd.CombinedOutput()
|
rawOutput, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Fallback to previous state
|
// Fallback to previous state
|
||||||
|
Loading…
Reference in New Issue
Block a user