Tag: 蓝图

如何编辑在cloudify运行的Docker容器中自动运行命令的蓝图

我想用cloudify方式运行RYU控制器的docker容器。 我已经写了一个蓝图文件,我可以创build相关的部署,并最终启动docker容器。 问题是,控制器(在docker容器内)需要实现一个脚本来运行,但我不知道如何修改蓝图文件来自动运行脚本。 每次,我都必须inputdocker exec CONTAINER ryu-manager /path/simple_switch.py作为目标。 那么谁也不知道应该把这个命令放在蓝图上。 我试图将其纳入 interfaces: cloudify.interfaces.lifecycle: create: implementation: docker.docker_plugin.tasks.create_container inputs: params: ports: – { get_input: docker_port } stdin_open: true tty: true command: /bin/bash start: implementation: docker.docker_plugin.tasks.start inputs: params: port_bindings: { get_input: container_port_binding } command: docker exec ryu ryu-manager /ryu/ryu/app/simple_switch.py # here ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ […]