Я хотел загрузить свою виртуальную машину Azure с помощью Docker и Docker-compose, используя cloud-init.Пока что попробовал что-то вроде ниже.
#cloud-config
package_update: true
package_upgrade: true
groups:
- docker: [default]
runcmd:
- [ sh, -c, "curl -sSL https://get.docker.com/ | sh" ]
- [ sh, -c, "sudo curl -L "https://github.com/docker/compose/releases/download/$(git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose" ]
- [ sh, -c, "sudo chmod +x /usr/local/bin/docker-compose" ]
Но он не устанавливает docker / docker-compose и получает ошибку ниже
cloud-init[958]: 2019-02-28 00:51:02,447 - util.py[WARNING]: Failed loading yaml blob. Invalid format at line 11 column 32: "while scanning a plain scalar
[ 333.241244] cloud-init[958]: in "<unicode string>", line 11, column 32:
[ 333.245521] cloud-init[958]: - [ sh, -c, "sudo curl -L "https://github.com/docker/compos ...
2019/02/28 00:51:04.015216 INFO Daemon Wire protocol version:2012-11-30
[ 333.245619] cloud-init[958]: ^
[ 333.259509] cloud-init[958]: found unexpected ':'
[ 333.259584] 2019/02/28 00:51:04.019282 INFO Daemon Server preferred version:2015-04-05
cloud-init[958]: in "<unicode string>", line 11, column 37:
[ 333.474295] cloud-init[958]: - [ sh, -c, "sudo curl -L "https://github.com/docker/compose/rel ...
[ 333.514672] cloud-init[958]: ^
[ 333.554215] cloud-init[958]: Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details."
[ 333.593764] cloud-init[958]: 2019/02/28 00:51:04.361760 INFO Daemon Waiting for ssh host key be generated at /etc/ssh/ssh_host_rsa_key.pub [1800 attempts remaining, sleeping 1s]
2019-02-28 00:51:02,470 - util.py[WARNING]: Failed loading yaml blob. Invalid format at line 11 column 32: "while scanning a plain scalar
[ 333.705350] cloud-init[958]: in "<unicode string>", line 11, column 32:
[ 333.731074] cloud-init[958]: - [ sh, -c, "sudo curl -L "https://github.com/docker/compos ...
[ 333.769118] cloud-init[958]: ^
[ 333.789992] cloud-init[958]: found unexpected ':'
[ 333.808855] cloud-init[958]: in "<unicode string>", line 11, column 37:
[ 333.831502] cloud-init[958]: - [ sh, -c, "sudo curl -L "https://github.com/docker/compose/rel ...
[ 333.863028] cloud-init[958]: ^
[ 333.885648] cloud-init[958]: Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details."
[ 333.915174] cloud-init[958]: 2019-02-28 00:51:02,470 - util.py[WARNING]: Failed at merging in cloud config part from part-001
Помимо этого я сомневаюсь, как добавить автоматически созданного пользователя Azure по умолчанию (которыйбыл предоставлен из пользовательского интерфейса) в группу докеров.