Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stream docker logs using Websocket to your browser.

License

NotificationsYou must be signed in to change notification settings

j-p-d-e-v/docker-logs-streamer-via-web-socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stream docker logs using Websocket to your browser.

Build

cargo build --release

Deploy

Help Command:

cargo run -- --helpUsage: docker-container-log-streamer --stream-key<STREAM_KEY> --host<HOST> --port<PORT>Options:      --stream-key<STREAM_KEY>          Stream Key usedfor Authentication      --host<HOST>          Hostin IPV4 IP Address format      --port<PORT>          The port number to use  -h, --help          Printhelp (see a summary with'-h')  -V, --version          Print version

Run usingcargo

cargo run -- --stream-key mystreamkey --host 0.0.0.0 --port 3090

Run using the compiled binary file.

Build binary

cargo build --release

Execute binary

./target/release/docker-container-log-streamer --stream-key mystreamkey --host 0.0.0.0 --port 3090

Testing

You use the random-messages scripts to build the docker container and execute the docker-compose to simular the docker logs streamer.

  1. Build the random-messages container.
cd testsdocker build. -t random_messages:latest
  1. Execute docker-compose.
docker-compose -f docker-compose-random-messages.yml up

You can simulate the log streaming using the provided frontend app.

  1. Execute docker-compose for the frontend.
cd testsdocker-compose -f docker-compose-frontend.yaml up -d
  1. Look for the container of the frontend.
docker ps Example:CONTAINER ID   IMAGE                    COMMAND                  CREATED       STATUS             PORTS                  NAMESe6b8bedb2193   node"docker-entrypoint.s…"   3 hours ago   Up 3 hours         0.0.0.0:7050->80/tcp   tests-nginx-1
  1. Grab the container id
dockerexec -it e6b8bedb2193"bash"
  1. Run the development server.
cd appyarn dev
  1. Open browser then go to
http://localhost:7090

Developer

JP Mateo (jpmateo022@gmail.com)


[8]ページ先頭

©2009-2026 Movatter.jp