Ask Your Question

how to install docker as root ?

asked 2017-04-21 06:04:54 -0500

zoubayer gravatar image

updated 2017-04-21 09:33:03 -0500

hi everyone , i would love to install docker in a cloud config file but i cant pass to root ! by the way i have first to set a password for my VM because i cant access my ubuntu vm if i dont here is my code

password: mypassword
chpasswd: { expire: False }
ssh_pwauth: True
  - sudo -s
    apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    echo "deb ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
    apt-get update
    apt-get install -y docker-engine
    usermod -aG docker ubuntu
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-04-21 09:32:19 -0500


You can use this script to install Docker and change the password

password: mypassword
chpasswd: { expire: False }
ssh_pwauth: True
package_upgrade: true
package_reboot_if_required: true
- apt-get update
- curl -fsSL | sh
- curl -fsSL | sudo apt-key add -


edit flag offensive delete link more


thanks a lot . and what if i want to add a shell scipt inside ! do i have to put shell: /bin/bash and then past my code ? ( so sorry this my first time using cloud config )

zoubayer gravatar imagezoubayer ( 2017-04-21 10:16:18 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-04-21 06:04:54 -0500

Seen: 128 times

Last updated: Apr 21 '17