summaryrefslogtreecommitdiff
path: root/pkg/spec/createconfig.go
diff options
context:
space:
mode:
authorBoaz Shuster <boaz.shuster.github@gmail.com>2020-01-01 09:53:25 +0200
committerBoaz Shuster <boaz.shuster.github@gmail.com>2020-03-03 14:27:11 +0200
commit11e5c53d1191f7a324f212aa2ca2ec2aad1b4676 (patch)
treed90b96daccd6e8459adac7a5553766c858bc3bde /pkg/spec/createconfig.go
parent1641ee61802ad5e13a9ddf0a20099fe31f73768d (diff)
downloadpodman-11e5c53d1191f7a324f212aa2ca2ec2aad1b4676.tar.gz
podman-11e5c53d1191f7a324f212aa2ca2ec2aad1b4676.tar.bz2
podman-11e5c53d1191f7a324f212aa2ca2ec2aad1b4676.zip
Add the rmi flag to podman-run to delete container image
The --rmi flag will delete the container image after its execution unless that image is already been used by another container(s). This is useful when one wants to execute a container once and remove any resources attached to it. Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Diffstat (limited to 'pkg/spec/createconfig.go')
-rw-r--r--pkg/spec/createconfig.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index 02678a687..eb2cac8b8 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -156,6 +156,7 @@ type CreateConfig struct {
Resources CreateResourceConfig
RestartPolicy string
Rm bool //rm
+ Rmi bool //rmi
StopSignal syscall.Signal // stop-signal
StopTimeout uint // stop-timeout
Systemd bool
@@ -233,6 +234,10 @@ func (c *CreateConfig) createExitCommand(runtime *libpod.Runtime) ([]string, err
command = append(command, "--rm")
}
+ if c.Rmi {
+ command = append(command, "--rmi")
+ }
+
return command, nil
}