Skip to content

Instantly share code, notes, and snippets.

@pratos
Last active July 18, 2017 11:53
Show Gist options
  • Save pratos/5987494bb4459950a20cade1a1c65e4a to your computer and use it in GitHub Desktop.
Save pratos/5987494bb4459950a20cade1a1c65e4a to your computer and use it in GitHub Desktop.
Using docker with Microsoft Azure

Creating docker application from local system using Docker CLI

  • To create a machine using Docker CLI:
    • docker-machine create --driver azure --azure-subscription-id <subs-id> --azure-location <location:eg. eastus> --azure-resource-group <resource-group-name if created/otherwise created automatically> --azure-size <vm-name> <machine-name>

NOTE: Every Resource group has upto 10 CPU Core limit, so if you get issues creating newer instances solution is to create a new resource group.

VM Sizes:

  • Listed here: VM Sizes
  • Naming convention is as provided: Standard_A1/Basic_A1, etc

Sometimes there are issues with Docker getting installed, it seems Azure guys get the bleeding edge version. Refer to the issue: Xenial (16.04) - Failed to start Docker Application Container Engine #22371

Solution is:

  • Remove Docker:

    • sudo apt-get remove docker*
    • sudo apt-get autoremove
    • sudo apt-get autoclean
  • Install previous version of docker (17.04.0ce worked for me)

    • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    • sudo apt-get update
    • sudo apt-get upgrade
    • apt-cache policy docker-ce
    • sudo apt-get install -y docker-ce=<version-name>
  • Edit /etc/default/docker file and add the option:

    • DOCKER_OPTS="-s overlay"
  • Then

    • systemctl restart docker.service

Adding user to sudo,docker group:

  • sudo usermod -aG docker ${USER}
  • su - ${USER}
  • id -nG
  • sudo usermod -aG docker username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment