Skip to content

FirstRun First Build

Bert Kleewein edited this page Feb 19, 2020 · 1 revision

Building your first docker image

The horton build command is used to build a docker image for testing. At a very minimum, it requires the language of the SDK to build. It gets the SDK source from github, produces an image, and pushes it to your local container registry.

First, install a local container registry

This is where Horton stores docker images by default. To do this, call docker run -d -p 5000:5000 --restart=always --name registry registry:2

Then build the image

Python is small and quick, so we'll test with that one. Run horton build --language pythonv2 (note that it's pythonv2 with the v2 at the end. This is the only language with the extra SDK version added. Others are simply c, java, csharp, and node)

Building images for language variants

Some languages have images authored for "variants", which are like versions of the language. In particular node has node6, node8, and node10 and Python has py27, py35, py36, py37, and py38.

To build an image for node6, you would run horton build --language node --variant node6. If the variant is not specified, the scripts use a default variant (the node default is currently node8 and the Python default is currently py37)

Building images for a different branch or different repo

By default, the scripts use the master branch. If you want to build from a different branch, use the --commit option: horton build --language python --commit my-bug-fix-branch

If you want to build an image from your clone of a repo, add the --repo option: horton build --language csharp --repo BertKleewein/azure-iot-sdk-csharp

Clone this wiki locally