mayli / docker-lightop

docker login manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Lightop

docker-lightop is a login manager for various sessions, which are docker containers that provides their own web interface. Currently, this project provides sessions including,

When user login to the session, the container, if not exist, will be created immediatey. The user home folder(~) in every containers of the same user will be mounted to the same volume. The public folder located at /mnt/public, which shares to the all users of this service.

docker-lightop will help to route the network traffic, either http or websocket, to specific container accroding to the URL. For example, docker-lightop routes the request http://$IP:$PORT/u/ubuntu-trusty-ttyjs/ to the IP address of container named $USER_ubuntu-trusty-ttyjs, where the service port is retrieved by image expose configuration of the image.

Build and Run

Build yourself

docker build --rm -t dorowu/lightop . 
docker build --rm -t dorowu/lightop-ubuntu-trusty-ttyjs docker-repo/ubuntu-trusty-ttyjs/
docker build --rm -t dorowu/lightop-ubuntu-trusty-lxde docker-repo/ubuntu-trusty-lxde

Run

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -p 6050:6050 -p 6051:6051 dorowu/lightop

Browse

http://$IP:6050/

that default account is admin/admin

Screenshot

API

IP=127.0.0.1
curl -sq -XPOST -c cookies.txt -d 'username=admin&password=admin' http://$IP:6050/login
curl -sq -b cookies.txt  http://$IP:6050/user/
curl -sq -b cookies.txt -XPOST -d "username=walker&password=walker" http://$IP:6050/user/
curl -sq -b cookies.txt  http://$IP:6050/user/
curl -sq -b cookies.txt -XDELETE http://$IP:6050/user/2
curl -sq -b cookies.txt http://$IP:6050/session
curl -sq -b cookies.txt http://$IP:6050/container/
curl -sq -b cookies.txt -XDELETE http://$IP:6050/container/6a72a2e5c372

About

docker login manager


Languages

Language:JavaScript 65.3%Language:Python 16.2%Language:HTML 13.4%Language:CSS 3.4%Language:Shell 0.9%Language:C 0.5%Language:Nginx 0.2%Language:Makefile 0.1%