mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00

Basic theory: We remove the container, but *only from the DB*. We leave it in c/storage, we leave the lock allocated, we leave it running (if it is). Then we create an identical container with an altered name, and add that back to the database. Theoretically we now have a renamed container. The advantage of this approach is that it doesn't just apply to rename - we can use this to make *any* configuration change to a container that does not alter its container ID. Potential problems are numerous. This process is *THOROUGHLY* non-atomic at present - if you `kill -9` Podman mid-rename things will be in a bad place, for example. Also, we can't rename containers that can't be removed normally - IE, containers with dependencies (pod infra containers, for example). The largest potential improvement will be to move the majority of the work into the DB, with a `RecreateContainer()` method - that will add atomicity, and let us remove the container without worrying about depencies and similar issues. Potential problems: long-running processes that edit the DB and may have an older version of the configuration around. Most notable example is `podman run --rm` - the removal command needed to be manually edited to avoid this one. This begins to get at the heart of me not wanting to do this in the first place... This provides CLI and API implementations for frontend, but no tunnel implementation. It will be added in a future release (just held back for time now - we need this in 3.0 and are running low on time). This is honestly kind of horrifying, but I think it will work. Signed-off-by: Matthew Heon <mheon@redhat.com>
5.3 KiB
5.3 KiB
% podman-container(1)
NAME
podman-container - Manage containers
SYNOPSIS
podman container subcommand
DESCRIPTION
The container command allows you to manage containers
COMMANDS
Command | Man Page | Description |
---|---|---|
attach | podman-attach(1) | Attach to a running container. |
checkpoint | podman-container-checkpoint(1) | Checkpoints one or more running containers. |
cleanup | podman-container-cleanup(1) | Cleanup the container's network and mountpoints. |
commit | podman-commit(1) | Create new image based on the changed container. |
cp | podman-cp(1) | Copy files/folders between a container and the local filesystem. |
create | podman-create(1) | Create a new container. |
diff | podman-diff(1) | Inspect changes on a container or image's filesystem. |
exec | podman-exec(1) | Execute a command in a running container. |
exists | podman-container-exists(1) | Check if a container exists in local storage |
export | podman-export(1) | Export a container's filesystem contents as a tar archive. |
init | podman-init(1) | Initialize a container |
inspect | podman-inspect(1) | Display a container or image's configuration. |
kill | podman-kill(1) | Kill the main process in one or more containers. |
list | podman-ps(1) | List the containers on the system.(alias ls) |
logs | podman-logs(1) | Display the logs of a container. |
mount | podman-mount(1) | Mount a working container's root filesystem. |
pause | podman-pause(1) | Pause one or more containers. |
port | podman-port(1) | List port mappings for the container. |
prune | podman-container-prune(1) | Remove all stopped containers from local storage. |
ps | podman-ps(1) | Prints out information about containers. |
rename | podman-rename(1) | Rename an existing container. |
restart | podman-restart(1) | Restart one or more containers. |
restore | podman-container-restore(1) | Restores one or more containers from a checkpoint. |
rm | podman-rm(1) | Remove one or more containers. |
run | podman-run(1) | Run a command in a container. |
runlabel | podman-container-runlabel(1) | Executes a command as described by a container image label. |
start | podman-start(1) | Starts one or more containers. |
stats | podman-stats(1) | Display a live stream of one or more container's resource usage statistics. |
stop | podman-stop(1) | Stop one or more running containers. |
top | podman-top(1) | Display the running processes of a container. |
unmount | podman-unmount(1) | Unmount a working container's root filesystem.(Alias unmount) |
unpause | podman-unpause(1) | Unpause one or more containers. |
wait | podman-wait(1) | Wait on one or more containers to stop and print their exit codes. |
SEE ALSO
podman, podman-exec, podman-run