Skip to content

Instantly share code, notes, and snippets.

@rajula96reddy
Last active March 23, 2018 11:23
Show Gist options
  • Save rajula96reddy/ab12879c07d0b78af9243cbc94310940 to your computer and use it in GitHub Desktop.
Save rajula96reddy/ab12879c07d0b78af9243cbc94310940 to your computer and use it in GitHub Desktop.

List

Run the following in a container

  1. apt-get update
  2. apt-get install ssh vim
  3. passwd Give a password
  4. vim /etc/ssh/sshd_config change the line 'PermitRootLogin prohibit-password' to 'PermitRootLogin yes'
  5. service ssh start
  6. Come out of the container & run docker ps -a. Copy the running container id
  7. run in a different terminal docker commit <id> <give a name>

From the host

  1. Use the committed image to create more containers as nodes
  2. Get the ip address of the container from /etc/hosts
  3. Run bootstrap command with the host ip like knife bootstrap ip-address -x root -P root -N "node_name"
  4. Container is now registered as node, check from chef manage console
  5. Create recipes & runbooks similar to the procedure for virtualmachine node
  6. Attach container & run chef-client to run the runbook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment