Questions tagged «yaml»

4
是否可以通过Shell脚本修改yml文件?
这就是我的docker-compose.yml的样子。 nginx: container_name: 'nginx' image: 'nginx:1.11' restart: 'always' ports: - '80:80' - '443:443' volumes: - '/opt/nginx/conf.d:/etc/nginx/conf.d:ro' links: - 'anything' 现在,我需要通过shell脚本(在ubuntu服务器上)添加一些内容。我不太确定是否有可能: 将新元素添加到nginx/links(如果不存在) newthing如果不存在newthing-block,则附加块 新内容应如下所示: nginx: container_name: 'nginx' image: 'nginx:1.11' restart: 'always' ports: - '80:80' - '443:443' volumes: - '/opt/nginx/conf.d:/etc/nginx/conf.d:ro' - '/etc/letsencrypt:/etc/letsencrypt' links: - 'anything' - 'newthing' newthing: container_name: foo image: 'newthing:1.2.3' …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.