Skip to content

Instantly share code, notes, and snippets.

@eldondev
Created February 25, 2015 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eldondev/b1cf4c53f134e578d062 to your computer and use it in GitHub Desktop.
Save eldondev/b1cf4c53f134e578d062 to your computer and use it in GitHub Desktop.
Lightning talk on go version of inetd for docker containers
Lightning Talk: inetd in Go for Docker
Reincarnating a 1980s tech with today's tools.
Eldon
docker.inetd@eldondev.com
* Disclaimer:
This is a lightning talk.
- It has not been reviewed.
- There will probably be lies, damn lies, and a demo.
- You may very well be better than this at me.
- But I put it in gists!
* inetd : You kids today have all the ram.
Once upon a time, when the world had 64k of ram, having services in memory was
an issue.
The answer: inetd, a service which "listens" on multiple ports, and
will start your server on demand.
_When_you_are_done,_please_go_ahead_and_exit!_
* inetd: The fastest way to get something on a network.
Rather than trying to worry about sockets, it is possible to write to stdin
and read from stdout. Lots of these services were read-only
(who remembers finger?) so they could be sandboxed in read-only ways.
_Really_fast_ways_to_get_a_service_on_the_network!_
* inetd : Is that actually installed on my computer?
- If you have linux, according to Wikipedia, systemd supports it :-p
- Mac has a version of this implemented in launchd.
- Also, chances are, if you use pxe, your tftp server is launched from inetd.
* So why did I care about this, anyway?
Docker is a fast way to get services on the net. We get certain levels
of isolation from containers.
I wanted a way to have "disposable" remote shells, such that I could log in,
do some data munging or install some tool, log out and just have the workspace
wiped. No fuss, no muss, nothing hanging around on any persistent machine, and
relatively low concern that some script I ran left (intentionally or unintentionally)
some malicious or painful mementos.
* Answer: inetd-style service in docker
[[https://gist.github.com/eldondev/07de01dd3f92d9e7016e][Minimal network container]]
[[https://gist.github.com/eldondev/dbed81f20133241149e8][docknetd.go]]
.code docknetd.go
* So did I get my disposable ssh containers?
Yes, but that's too much for a lightning talk
- Make it available to anyone!
- Use ec2 spot instances so it is cheap, and geographical
- First 15 minutes free, fund the rest with bitcoin
- Option to download the filesystem?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment