Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for for Azure. #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ We therefore wrote a python module called *linux* (take a look at [linux.c](linu
Have a look at the [module documentation](https://rawgit.com/Fewbytes/rubber-docker/master/docs/linux/index.html) for more info.

## Quickstart
### On AWS
There are currently 3 options to start the workshop by yourself:
1. We created a public AMI with the required configuration and utilities
already installed:
Expand All @@ -34,6 +35,30 @@ There are currently 3 options to start the workshop by yourself:
1. We have a [Vagrantfile](https://www.vagrantup.com/) for you to run using
your favorite virtual machine hypervisor (NOTE: not yet fully tested).

### On Azure
We have a [packer template](https://www.packer.io/) so you can create your own
VM on Azure with the following procedure:

1. Build the image with Packer:
```bash
$ packer build packer/rubber-docker-azure.json
```
1. Create the VM based on the new image:
```bash
az vm create \
--resource-group PackerImages \
--name rubber-docker \
--location westus2 \
--image rubberDocker \
--admin-user ubuntu \
--generate-ssh-keys
```
1. Once the VM is built, you can connect to it with SSH with the username `ubuntu` and
newly created private key:

```bash
$ ssh ubuntu@<myPublicIP> -i ~/.ssh/ubuntu
```
The workshop material is checked out at `/workshop` on the instance:
- `/workshop/rubber-docker` - this repository, where you do all the work
- `/workshop/images` - images for containers, already populated with ubuntu and busybox images
Expand Down
52 changes: 52 additions & 0 deletions packer/rubber-docker-azure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}"
},
"builders": [{
"type": "azure-arm",

"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"subscription_id": "{{user `subscription_id`}}",

"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",

"managed_image_resource_group_name": "PackerImages",
"managed_image_name": "rubberDuck",

"location": "West US 2",
"vm_size": "Standard_DS2_v2"
}],
"provisioners": [{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"adduser --disabled-password --gecos \"\" ubuntu"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
},
{
"type": "file",
"source": "vimrc",
"destination": "/tmp/vimrc"
},
{
"type": "shell",
"script": "bootstrap.sh"
},
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"/usr/sbin/waagent -force -deprovision && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
}