Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitbull-team/docker-exec-web-console
A web UI to docker exec from the browser
https://github.com/bitbull-team/docker-exec-web-console
docker golang shell terminal web-ui xterm-js
Last synced: 8 days ago
JSON representation
A web UI to docker exec from the browser
- Host: GitHub
- URL: https://github.com/bitbull-team/docker-exec-web-console
- Owner: bitbull-team
- Created: 2017-07-18T13:07:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T16:40:03.000Z (over 3 years ago)
- Last Synced: 2024-08-01T12:19:43.764Z (3 months ago)
- Topics: docker, golang, shell, terminal, web-ui, xterm-js
- Language: JavaScript
- Homepage:
- Size: 3.02 MB
- Stars: 85
- Watchers: 9
- Forks: 39
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `docker exec` web console
This image is originally inspirated
by [this gist](https://gist.github.com/Humerus/0268c62f359f7ee1ee2d).The container use `socat` to bound Docker socket to a TCP port, so that I could avoid to change
the `http.Post` part in the Go server to talk directly to a UNIX socket.You can launch the container in this way:
```
docker run \
--name docker-exec-web-console \
-p 9999:8888 \
-v /var/run/docker.sock:/var/run/docker.sock \
bitbull/docker-exec-web-console
```Then you can reach the console at the url `http://localhost:9999`
It's possible to pass a context path to which the container will responds, using `CONTEXT_PATH`
environment variable:```
docker run \
--name docker-exec-web-console \
-p 9999:8888 \
-e "CONTEXT_PATH=/webconsole" \
-v /var/run/docker.sock:/var/run/docker.sock \
bitbull/docker-exec-web-console
```With the above example, the console will be reachable at the url `http://localhost:9999/webconsole`
You can select the container to exec into passing its id directly via `cid` querystring parameter (
eg. `http://localhost:9999?cid=` ) or in the prompt that will show at page load.You can pass the command to execute passing it via `cmd` querystring parameter (
eg. `http://localhost:9999?cid=&cmd=/bin/sh` ), otherwise it default to `/bin/bash`.## Build the image
The image is based on `alpine:latest`, so you need to compile the server for Linux with all libs
statically linked:```
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
```then you can build as usual:
```
docker build -t bitbull/docker-exec-web-console .
```