Я пытаюсь запустить файл в Docker с помощью Docker Remote API, команда выглядит примерно так:
> python /src/app/stdin/test.py < /src/app/stdin/1.txt >
> /src/app/stdout/1.txt 2> /src/app/stderr/1.txt
Но stdin, stdout & stderr не влияют на test.py , он работает в системе в ожидании ввода.
Можете ли вы указать, что я делаю неправильно?
Я уже пытался создать контейнер / EXEC сattachStdin = False и каждая комбинация AttachStdin, AttachStdout и AttachStdout.
POST /containers/20a142da85b9/exec HTTP/1.11
User-Agent: Docker.DotNet
Host: localhost:2375
Connection: close
Content-Type: application/json; charset=utf-8
Content-Length: 391
{"Privileged":true,"Tty":true,"AttachStdin":true,"AttachStderr":true,"AttachStdout":true,"Cmd":["python","/src/app/Folder_7c9739e4x7ee6x40d1xb56exb136d4333b0a/stdin/test.py","<","/src/app/Folder_7c9739e4x7ee6x40d1xb56exb136d4333b0a/stdin/1.txt",">","/src/app/Folder_7c9739e4x7ee6x40d1xb56exb136d4333b0a/stdout/1.txt","2>","/src/app/Folder_7c9739e4x7ee6x40d1xb56exb136d4333b0a/stderr/1.txt"]}HTTP/1.1 201 Created
Api-Version: 1.40
Content-Length: 74
Content-Type: application/json
Date: Wed, 16 Oct 2019 09:42:35 GMT
Docker-Experimental: false
Ostype: linux
Server: Docker/19.03.2 (linux)
Connection: close
{"Id":"457fdcaf26280082edefff53d0098e7c7645b22e7e5e3cb073a055a90fd80c37"}
POST /exec/457fdcaf26280082edefff53d0098e7c7645b22e7e5e3cb073a055a90fd80c37/start HTTP/1.11
User-Agent: Docker.DotNet
Host: localhost:2375
Connection: close
Content-Type: application/json; charset=utf-8
Content-Length: 60
{"AttachStdin":true,"AttachStderr":true,"AttachStdout":true}HTTP/1.1 200 OK
Api-Version: 1.40
Content-Type: application/vnd.docker.raw-stream
Docker-Experimental: false
Ostype: linux
Server: Docker/19.03.2 (linux)
Transfer-Encoding: identity
Date: Wed, 16 Oct 2019 09:43:47 GMT
Connection: close