Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Is your feature request related to a problem? Please describe.
Distrobox is a nice piece of software to not mess up my host os when playing around in a container, but it currently provides no convenient way to save me from messing up the container itself. It would be great if distrobox would allow me to create a snapshot of a container and restore it, if whatever I did ended badly. At the moment I'd have to perform the snapshoting myself and handle the removal of old snapshots myself as well.
Describe the solution you'd like
distrobox snapshot would be a new command that with the following syntax/options:
distrobox snapshot create $ctr --snapshot-name $name: would create a new snapshot, the name of the snapshot would be optional
distrobox snapshot cleanup $ctr --keep $N: would delete everything but the latest $N (optional parameter, defaults to something between 5 to 10) snapshots of all containers or the provided container
distrobox snapshot list $ctr: list all snapshots of a container
distrobox rollback $ctr --snapshot $name: restore the container $ctr to the last snapshot or the one with the provided name
Describe alternatives you've considered
using podman container commit -p $ctr $name manually and re-starting distrobox as described in the docs.
Additional context
A possible implementation could just store the containers in the container runtime's storage. Snapshots could be created using the id of the container, e.g. via:
podman container commit -p $ctr distrobox-snapshot-$(podman inspect -f {{.Id}} $ctr):$(date +%s)
which would create unique time snapshots (unless the user decides to create snapshots more frequently than once per second…).
Is your feature request related to a problem? Please describe.
Distrobox is a nice piece of software to not mess up my host os when playing around in a container, but it currently provides no convenient way to save me from messing up the container itself. It would be great if distrobox would allow me to create a snapshot of a container and restore it, if whatever I did ended badly. At the moment I'd have to perform the snapshoting myself and handle the removal of old snapshots myself as well.
Describe the solution you'd like
distrobox snapshot
would be a new command that with the following syntax/options:distrobox snapshot create $ctr --snapshot-name $name
: would create a new snapshot, the name of the snapshot would be optionaldistrobox snapshot cleanup $ctr --keep $N
: would delete everything but the latest $N (optional parameter, defaults to something between 5 to 10) snapshots of all containers or the provided containerdistrobox snapshot list $ctr
: list all snapshots of a containerdistrobox rollback $ctr --snapshot $name
: restore the container $ctr to the last snapshot or the one with the provided nameDescribe alternatives you've considered
using
podman container commit -p $ctr $name
manually and re-starting distrobox as described in the docs.Additional context
A possible implementation could just store the containers in the container runtime's storage. Snapshots could be created using the id of the container, e.g. via:
podman container commit -p $ctr distrobox-snapshot-$(podman inspect -f {{.Id}} $ctr):$(date +%s)
which would create unique time snapshots (unless the user decides to create snapshots more frequently than once per second…).