【发布时间】:2019-02-14 05:07:50
【问题描述】:
我正在尝试通过标准输入将 Dockerfile 传输到docker build,如下所述:
https://docs.docker.com/engine/reference/commandline/build/#specify-a-dockerfile--f
我已经尝试了所有方法,但 Docker 似乎不接受我的标准输入。
const dockerfileStr = 'FROM alpine-node'
const child = spawn('docker build . -f -', {shell:true, stdio: ['pipe', 'inherit']})
child.stdin.write(dockerfileStr + '\n')
child.stdin.end()
也许它需要tty?
添加此请求的 PR 在这里:https://github.com/moby/moby/pull/31236/files
【问题讨论】:
标签: node.js docker child-process