mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
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>
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user