I am assuming when launching the container implies setting working directory at container startup time. If not, using workingDir parameter as answered above works. I wanted the container launch command to work with a preset working directory and so I used the following pattern:
3条答案
按热度按时间wwtsj6pe1#
是的,通过容器规范的
workingDir
字段。下面是一个示例复制控制器,其中nginx容器将workingDir
设置为/workdir
:xe55xuns2#
I am assuming when launching the container implies setting working directory at container startup time. If not, using
workingDir
parameter as answered above works. I wanted the container launchcommand
to work with a preset working directory and so I used the following pattern:n53p2ov03#
It should be also possible to set the working directory using env and command attributes. Below is an example: