我希望通过Rancher的REST API可以做到这一点。有没有人知道这是否可能?
cat data.txt | docker exec -i my_container sh -c 'cat >/data.txt'似乎我可以使用以下命令与docker exec进行交互:
curl -X "POST" "http://123.123.123.123:8080/v2-beta/containers/1i177?action=execute" \
-H "Cookie: PL=rancher" \
-H "Content-Type: application/json" \
-u user:password \
-d $'{
"attachStdin": true,
"attachStdout": true,
"command": [
"ls"
],
"tty": true
}'这将返回以下内容:
url":"ws:\/\/123.123.123.123:8080\/v1\/exec\/"所以我假设我需要使用WebSocket连接到它?
https://stackoverflow.com/questions/41261665
复制相似问题