Skip to content

Instantly share code, notes, and snippets.

@codyde
Created July 8, 2019 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codyde/7ac0d16c54bf1d8a68f677afc131e401 to your computer and use it in GitHub Desktop.
Save codyde/7ac0d16c54bf1d8a68f677afc131e401 to your computer and use it in GitHub Desktop.
Docker Host Build CAS
name: Docker Host Build - Ubuntu
version: v2
inputs:
username:
type: string
password:
type: string
encrypted: true
resources:
Cloud_Machine_1:
type: Cloud.Machine
properties:
image: Ubuntu
flavor: small
constraints:
- tag: 'env:vsphere'
cloudConfig: |
#cloud-config
ssh_pwauth: yes
chpasswd:
list: |
${input.username}:${input.password}
expire: false
users:
- default
- name: ${input.username}
passwd: ${input.password}
lock_passwd: false
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups: [wheel, sudo, admin]
shell: '/bin/bash'
package_update: true
packages:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
runcmd:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- apt-key fingerprint 0EBFCD88 -y
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- apt-get update -y
- apt-get install docker-ce -y
- sed -i 's@ExecStart=/usr/bin/dockerd -H fd://@ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock@' /lib/systemd/system/docker.service
- systemctl daemon-reload
- systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment