Crates.io | docker-container-log-streamer |
lib.rs | docker-container-log-streamer |
version | 0.1.0 |
source | src |
created_at | 2024-05-25 12:14:53.761638 |
updated_at | 2024-05-25 12:14:53.761638 |
description | A Rust library for streaming docker logs via websocket. |
homepage | |
repository | https://github.com/j-p-d-e-v/docker-logs-streamer-via-web-socket |
max_upload_size | |
id | 1251916 |
size | 108,931 |
Stream docker logs using Websocket to your browser.
cargo build --release
cargo run -- --help
Usage: docker-container-log-streamer --stream-key <STREAM_KEY> --host <HOST> --port <PORT>
Options:
--stream-key <STREAM_KEY>
Stream Key used for Authentication
--host <HOST>
Host in IPV4 IP Address format
--port <PORT>
The port number to use
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
cargo
cargo run -- --stream-key mystreamkey --host 0.0.0.0 --port 3090
Build binary
cargo build --release
Execute binary
./target/release/docker-container-log-streamer --stream-key mystreamkey --host 0.0.0.0 --port 3090
You use the random-messages scripts to build the docker container and execute the docker-compose to simular the docker logs streamer.
cd tests
docker build . -t random_messages:latest
docker-compose -f docker-compose-random-messages.yml up
You can simulate the log streaming using the provided frontend app.
cd tests
docker-compose -f docker-compose-frontend.yaml up -d
docker ps
Example:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e6b8bedb2193 node "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:7050->80/tcp tests-nginx-1
docker exec -it e6b8bedb2193 "bash"
cd app
yarn dev
http://localhost:7090
JP Mateo (jpmateo022@gmail.com)