Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

how to use docker port mapping with a specific app (Goreplay)

i need help in running a specific docker container.

i am trying to use this project [Goreplay] (https://github.com/buger/goreplay) which is basically a tool to record your live traffic.

for example here https://github.com/buger/goreplay/wiki/Getting-Started#saving-requests-to-file-and-replaying-them-later i can save the request to a file , with this command : sudo ./gor --input-raw :8000 --output-file=requests.gor

where 8000 is the port in which my local app or server is running.

Now, i want to use docker, so i found this image https://hub.docker.com/r/buger/goreplay

i want to capture traffic of my same local server which run on port 8000, but with the goreplay in the docker container .. problem is i didn't know how to map the port correctly, i've tried this :

docker run -i -t --rm -p 8000:8000 --name mygoreplay buger/goreplay --input-raw :3000 --output-file=requests_docker.gor

but it says

docker: Error response from daemon: driver failed programming external connectivity on endpoint mygoreplay (b5c52ad18f266110085891015fed420c8548145a96837bcd09df464158261272): Error starting userland proxy: listen tcp 0.0.0.0:8000: bind: address already in use. ERRO[0004] error waiting for container: context canceled

how to map the port correctly so i goreplay in the container can track traffic the local server ??

and a side question: where will i find the file requests_docker.gor? now that the goreplay is in a docker container ?

thank you in advanced.

question from:https://stackoverflow.com/questions/65893978/how-to-use-docker-port-mapping-with-a-specific-app-goreplay

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...