Freeze. Thaw. Repeat.
See it live in this ASCII video demo!
docker run -t -i --privileged --name critmux jpetazzo/critmux
- Do stuff in tmux. Don't know what to do? Just type a few characters.
- From another terminal,
docker stop critmux. Container stops.
docker start critmux ; docker attach critmux. MIND. BLOWN.
docker start -a doesn't quite work.
This container starts a little wrapper, which sets up a
signal handler. Then it checks if there is some saved state in
- if there is no saved state, we assume a clean start, setup a
tmuxsession, and attach to it;
- if there is a saved state, it is restored it (it should be a tmux daemon process), then we attach to tmux.
The signal handler just sends a detach command to tmux; and the
wrapper arranges for the state to be saved when tmux is detached.
In other words, when detaching from tmux, or when sending
or when doing
docker stop on the container, we end up saving its
You need a fairly recent kernel. Debian's 3.14 works; some people reported that 3.13 didn't.
AUFS won't work.