当我运行一些 docker 容器时,我需要在命令行上提供参数(docker run image some-parameters
)。在 OpenShift Origin 中使用 oc new-app 时如何提供相同的参数?
最佳答案
# Create an application based on a template file, explicitly setting a parameter value
$ oc new-app --file=./example/myapp/template.json --param=MYSQL_USER=admin
--param
选项在这里很有用。
注意:oc run
example包括:
# Start a single instance of nginx, but overload the spec of the replication
# controller with a partial set of values parsed from JSON.
$ oc run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
该 json 可以包含参数部分,this one 也是如此。由 sti_incremental.go#L39
使用.
关于docker - 如何在 OpenShift 中使用 "oc new-app"向 docker run 提供参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34624992/