aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorAditya R <arajan@redhat.com>2022-02-22 22:10:34 +0530
committerAditya R <arajan@redhat.com>2022-02-23 17:38:28 +0530
commitfbbcb957c710ab817c969a8dc3ff3c46619604e2 (patch)
tree33971ff9377ee3cbf455ebe4c915722d3c3438bc /libpod
parent0cfb5d7e75507783e463e0df645e873e5a77bbfa (diff)
downloadpodman-fbbcb957c710ab817c969a8dc3ff3c46619604e2.tar.gz
podman-fbbcb957c710ab817c969a8dc3ff3c46619604e2.tar.bz2
podman-fbbcb957c710ab817c969a8dc3ff3c46619604e2.zip
container-commit: support --squash to squash layers into one
Allow users to commit containers into a single layer. Usage ```bash podman container commit --squash <name> ``` Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_commit.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/container_commit.go b/libpod/container_commit.go
index 99d08ccf1..7018ee7d8 100644
--- a/libpod/container_commit.go
+++ b/libpod/container_commit.go
@@ -27,6 +27,7 @@ type ContainerCommitOptions struct {
Author string
Message string
Changes []string
+ Squash bool
}
// Commit commits the changes between a container and its image, creating a new
@@ -63,6 +64,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
commitOptions := buildah.CommitOptions{
SignaturePolicyPath: options.SignaturePolicyPath,
ReportWriter: options.ReportWriter,
+ Squash: options.Squash,
SystemContext: c.runtime.imageContext,
PreferredManifestType: options.PreferredManifestType,
}