Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpetazzo/critmux
Docker + CRIU + tmux = magic!
https://github.com/jpetazzo/critmux
Last synced: 10 days ago
JSON representation
Docker + CRIU + tmux = magic!
- Host: GitHub
- URL: https://github.com/jpetazzo/critmux
- Owner: jpetazzo
- Created: 2014-05-31T03:34:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-09-13T09:28:32.000Z (about 3 years ago)
- Last Synced: 2024-08-02T02:13:09.189Z (3 months ago)
- Language: Dockerfile
- Size: 1.95 KB
- Stars: 120
- Watchers: 8
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Freeze. Thaw. Repeat.
This is a tech demo of [CRIU] and [Docker] integration, featuring [tmux].
See it live in this [ASCII video demo]!
1. ``docker run -t -i --privileged --name critmux jpetazzo/critmux``
2. Do stuff in tmux. Don't know what to do? Just type a few characters.
3. From another terminal, ``docker stop critmux``. Container stops.
4. ``docker start critmux ; docker attach critmux``. MIND. BLOWN.Note: ``docker start -a`` doesn't quite work.
## What the?
This container starts a little wrapper, which sets up a ``SIGTERM``
signal handler. Then it checks if there is some saved state in
``/state``:- if there is no saved state, we assume a clean start, setup a
``tmux`` session, 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 ``SIGTERM``,
or when doing ``docker stop`` on the container, we end up saving its
state.## Requirements
You need a fairly recent kernel. Debian's 3.14 works; some people
reported that 3.13 didn't.AUFS won't work.
[ASCII video demo]: https://asciinema.org/a/9889
[CRIU]: http://criu.org/
[Docker]: http://www.docker.com/
[tmux]: http://tmux.sourceforge.net/