Building Images Using Docker

The samples rely on Docker for both the Genvid Services and for building and running the website. Although you can install a version of Docker locally, creating a build server on Azure using a Docker Machine is a simpler alternative.

See Install Docker on Windows if you prefer to use a local build-machine.

Create a Docker Build Machine

To be able to configure a Docker Machine, you first need to know your Azure Subscription ID. From your shell window:

  1. Run the command:

    az account show
  2. Find the ID in the output.

  3. Create the Docker Build Machine.

    bin\docker-machine create --driver azure --azure-subscription-id [your subscription id] --azure-location "eastus" [docker-name]
    • [docker-name] is a unique name for the machine.
    • [your subscription id] is your Azure subscription ID.

Building a Project Using a Docker Machine

To describe building a project using a Docker Machine, we’ll use the Tutorial Sample.

The Tutorial sample has only a small amount of content, so we can build an archive and make it available for upload under the images subdirectory. This command also builds the website which requires Docker to succeed, so you need to advertise your Docker installation or server.

The command you use depends on your shell. In all cases, [docker-name] is the name you chose or default if you’re running Docker locally.

From the Windows command prompt, run:

@FOR /f "tokens=*" %i IN ('"bin\docker-machine" env [docker-name]') DO @%i

From a Bash shell window, run:

eval $(bin/docker-machine env [docker-name])

From a PowerShell window, run:

bin/docker-machine env [docker-name] | Invoke-Expression

Shut Down the Docker Machine

When you’re done with the machine, you can shut it down using:

bin\docker-machine rm [docker-name]