Unable to start kurento media server with docker - docker

I'm trying to run kurent-media-server, by following the instructions found here:
https://hub.docker.com/r/kurento/kurento-media-server
I've followed them, but I am still unable to connect to the server.
After running
$ docker run --name kms -d -p 8888:8888 \
kurento/kurento-media-server
$ curl -i -N \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Host: 127.0.0.1:8888" \
-H "Origin: 127.0.0.1" \
http://127.0.0.1:8888/kurento
I get curl: (56) Recv failure: Connection reset by peer, instead of
HTTP/1.1 500 Internal Server Error
Server: WebSocket++/0.7.0
How can I fix this? I seem to have done done everything properly.

Try using latest image of kurento-media-server docker. I am using version 6.13.2 and it works fine for me.

Related

TensorFlow model server - Could not resolve host POST

I am new to TensorFlow (using 1.13) and trying to build a TF model and serve it on a docker tensor flow model server.
I have exported my model, installed docker and started my docker container with the command:
docker run -p 8501:8501 --name SN_TFlow
--mount type=bind,source=/tmp/service_model/export,target=/models
-e MODEL_NAME=1596551653 -t tensorflow/serving &
I can see my container running and the line: "I tensorflow_serving/model_servers/server.cc:375] Exporting HTTP/REST API at:localhost:8501 ..." in the client which seems to indicate all is up and running according to the doc.
However when I try to test my model with the curl command:
$ curl -d ‘{"test_value": [40]}' \ -X POST http://localhost:8501/1/models/1596551653:predict
I get a message saying:
URL bad/illegal format or missing url
Could not resolve host POST
and I get a 404 message.
I also tried simply curl http://localhost:8501/models/1/1596551653 but also get Not found.
Any idea what I am missing? Thanks
The problem I observe in your code is the \ in the middle of the curl command.
The backslash, \ should occur at the end of the line, if the command is more than one line.
So, the below command,
$ curl -d ‘{"test_value": [40]}' \ -X POST
http://localhost:8501/1/models/1596551653:predict
should be changed as shown below (move the backslash to the end) :
$ curl -d ‘{"test_value": [40]}' -X POST \
http://localhost:8501/1/models/1596551653:predict
Also, we suggest you to upgrade to the Latest Version of Tensorflow in 1.x, which is 1.15 or to 2.3.0.

Docker exec. How to use shell-commands in container without entering?

Can someone explain me, how can I use sh-commands inside container without enter that container?
I use a shell script at my host. I want this shell-script to enter one of my container and then curl post to another container through overall network. So, my problem is that when i tring to do something like:
docker exec -ti nodejs sh "curl -X POST \
http://tgbot:3017/deploy \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'message=Prod has been updated!'"
I have in console:
sh: 0: Can't open curl -X POST http://tgbot:3017/ -H 'Content-Type: application/x-www-form-urlencoded' -H 'cache-control: no-cache' -d 'message=Prod has been updated!'
failed to resize tty, using default size
Or mayby I can curl into docker network right from host somehow?
You can just use Docker exec command on the host machine.
docker exec -it <container name> <command>

How to execute "docker checkpoint create container_id checkpoint_id" using curl?

At the moment of writing, docker checkpoint feature is still in experimental phase so there is no official (HTTP) API documentation. Nonetheless, there is an endpoint on the docker daemon that can accept an HTTP request, as it is the one that docker cli uses.
Based on the related docker source code it should be something like
sudo curl -X POST --unix-socket /var/run/docker.sock http://localhost/v1.32/containers/20fb4f16ff10/checkpoints
but this does not work. Any ideas what I may be missing?
The create options is missing.
curl --unix-socket /var/run/docker.sock \
-H "Content-Type: application/json" \
-d '{"CheckpointID": "noting"}' \
-X POST http:/v1.32/containers/20fb4f16ff10/checkpoints

Docker behind VPN cannot start after downloading TFS container

I have a docker cluster behind a VPN. I have downloaded TFS agent container, and want to connect to our TFS but it cannot connect with an alarm of:
Determining matching VSTS agent...
Downloading and installing VSTS agent...
curl: (35) gnutls_handshake() failed: Error in the pull function.
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
It can ping google.But cannot ping public TFS. I would consider this as a network issue but nginx container was pulled and started with success.
docker run \
-e VSTS_ACCOUNT= xxx \
-e TFS_HOST= yyy \
-e VSTS_TOKEN= zzz \
-it microsoft/vsts-agent
also tried this:
docker run \
-e VSTS_ACCOUNT= xxx \
-e VSTS_AGENT='$(hostname)-agent'\
-e VSTS_TOKEN= yyy \
-e TFS_URL= zzz \
-e VSTS_POOL= eee \
-e VSTS_WORK='/var/vsts/$VSTS_AGENT' \
-v /var/vsts:/var/vsts \
-it microsoft/vsts-agent:ubuntu-14.04
Although it is behind VPN, I can access the repo from browser btw.
It seems docker shows SSL Handshake issue even if you have network issue. But it showing that connection through curl was OK. This issue was solved by adding IP to whitelist.

hyperkube gets stuck while trying to start the API server

I am running Kubernetes 1.5.0 in hyperkube and it gets stuck with the following lines cyclically repeating in the logs:
E0228 21:28:35.891472 20321 reflector.go:188] pkg/kubelet/config/apiserver.go:44: Failed to list *api.Pod: Get http://localhost:8443/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp 127.0.0.1:8443: getsockopt: connection refused
E0228 21:28:35.892410 20321 reflector.go:188] pkg/kubelet/kubelet.go:386: Failed to list *api.Node: Get http://localhost:8443/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp 127.0.0.1:8443: getsockopt: connection refused
Here is how I am starting Hyperkube:
docker run \
--volume=/:/rootfs:ro \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:rw \
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
--volume=/var/run:/var/run:rw \
--net=host \
--pid=host \
--privileged=true \
--name=kube -d \
gcr.io/google-containers/hyperkube:v1.5.3 \
/hyperkube kubelet --containerized \
--hostname-override="127.0.0.1" \
--address="0.0.0.0" \
--api-servers=http://localhost:8443 \
--allow-privileged=true --v=2
To second the comment from #nehal-j-wani, 8443 is the secure port, but you're using the http scheme, without any client or CA certificate.
Sounds like you are not intending to communicate with your local API server over TLS, so you should rather either:
use the insecure port (defaults to 8080)
fix your kubelet flags to use the TLS communication properly
See also:
kubelet
TLS bootstrapping

Resources