Piping a file into docker run

后端 未结 2 1823
野性不改
野性不改 2021-01-31 14:08

I need to pipe (inject) a file or some data into docker as part of the run command and have it written to a file within the container as part of the startup. Is there best pract

2条回答
  •  青春惊慌失措
    2021-01-31 14:49

    cat setup.json |  docker run -i  ubuntu /bin/bash -c 'cat'
    

    This worked for me. Remove the -t. Don't need the -a's either.

提交回复
热议问题