|
| 1 | +--- |
| 2 | +title:"ARM Support" |
| 3 | +description:"Use Docker containers on ARM architecture" |
| 4 | +group:incubation |
| 5 | +redirect_from: |
| 6 | + -/docs/incubation/arm-support/ |
| 7 | +toc:true |
| 8 | +--- |
| 9 | + |
| 10 | +Codefresh is offering initial support for building Docker images for the ARM architecture. ARM support |
| 11 | +is only available to Enterprise customers. |
| 12 | + |
| 13 | +##Enabling ARM support |
| 14 | + |
| 15 | +To run ARM pipelines in Codefresh,[open a free account]({{site.baseurl}}/docs/administration/account-user-management/create-codefresh-account/) and then[contact sales](https://codefresh.io/contact-us/){:target="\_blank"} in order to enable ARM support. |
| 16 | + |
| 17 | +>Due to unforeseen circumstances, we are currently unable to support ARM builds on our SaaS infrastructure. We apologize for the inconvenience. |
| 18 | +
|
| 19 | +Once approved, you will get access to a new runtime environment installed on an ARM cluster. This means that you will be able to run both ARM and Linux/x86 builds from the same Codefresh account by choosing the appropriate[pipeline settings]({{site.baseurl}}/docs/pipelines/pipelines/#pipeline-settings). |
| 20 | + |
| 21 | +##Using ARM builders in Codefresh |
| 22 | + |
| 23 | +Once ARM support is enabled for your account, there is no other special requirement to start building ARM images. |
| 24 | + |
| 25 | +Just read the Codefresh documentation: |
| 26 | + |
| 27 | +*[Introduction to Pipelines]({{site.baseurl}}/docs/pipelines/introduction-to-codefresh-pipelines/) |
| 28 | +*[Creating a Pipeline]({{site.baseurl}}/docs/pipelines/pipelines/) |
| 29 | +*[Codefresh YAML]({{site.baseurl}}/docs/pipelines/what-is-the-codefresh-yaml/) |
| 30 | +*[Working with Docker registries]({{site.baseurl}}/docs/ci-cd-guides/working-with-docker-registries/) |
| 31 | +*[On demand environments]({{site.baseurl}}/docs/quick-start/ci-quick-start/on-demand-environments/) |
| 32 | + |
| 33 | + |
| 34 | +The only important thing to notice is to make sure that the base Docker images you use are ARM-compiled. |
| 35 | + |
| 36 | +Most popular Docker images (i.e., Alpine) already offer ARM support so all your builds should work right away. |
| 37 | + |
| 38 | +{% include |
| 39 | +image.html |
| 40 | +lightbox="true" |
| 41 | +file="/images/incubation/arm-support/arm-support.png" |
| 42 | +url="/images/incubation/arm-support/arm-support.png" |
| 43 | +alt="Checking for ARM images in Dockerhub" |
| 44 | +caption="Checking for ARM images in Dockerhub" |
| 45 | +max-width="60%" |
| 46 | +%} |
| 47 | + |
| 48 | +Dockerhub has a lot of public images that are offered in multiple architectures. |
| 49 | +You will get errors only if you use a less popular image that has no ARM support. |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +##Example for an ARM build |
| 54 | + |
| 55 | +The[Python sample application](https://github.com/codefresh-contrib/python-flask-sample-app){:target="\_blank"} used in the[quick start guide]({{site.baseurl}}/docs/quick-start/ci-quick-start/create-ci-pipeline/) is based on an official Docker image that already has ARM support. |
| 56 | + |
| 57 | +Create a pipeline for it with the following YAML content: |
| 58 | + |
| 59 | +`codefresh.yml` |
| 60 | +{% highlight yaml %} |
| 61 | +{% raw %} |
| 62 | +version: '1.0' |
| 63 | +steps: |
| 64 | + main_clone: |
| 65 | + title: 'Cloning main repository...' |
| 66 | + type: git-clone |
| 67 | + repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}' |
| 68 | + revision: '${{CF_REVISION}}' |
| 69 | + git: github |
| 70 | + MyArmDockerImage: |
| 71 | + title: Building Docker ARM Image |
| 72 | + type: build |
| 73 | + image_name: python-flask-sampleapp-arm |
| 74 | + tag: '${{CF_BRANCH_TAG_NORMALIZED}}' |
| 75 | + dockerfile: Dockerfile |
| 76 | + MyUnitTests: |
| 77 | + title: Running Unit tests |
| 78 | + image: ${{MyArmDockerImage}} |
| 79 | + commands: |
| 80 | + - uname -a |
| 81 | + - python setup.py test |
| 82 | +{% endraw %} |
| 83 | +{% endhighlight %} |
| 84 | + |
| 85 | +This pipeline creates a Docker image for a python application and then runs unit tests inside it. |
| 86 | + |
| 87 | +It contains three[steps]({{site.baseurl}}/docs/codefresh-yaml/steps/): |
| 88 | + |
| 89 | +1. A[clone step]({{site.baseurl}}/docs/pipelines/steps/git-clone/) that checks out code from the Git repository. |
| 90 | +1. A[build step]({{site.baseurl}}/docs/pipelines/steps/build/) that reads a Dockerfile and creates a Docker image. |
| 91 | +1. A[freestyle step]({{site.baseurl}}/docs/pipelines/steps/freestyle/) that runs unit tests. |
| 92 | + |
| 93 | +The logs verify that this is an ARM image: |
| 94 | + |
| 95 | +{% include |
| 96 | +image.html |
| 97 | +lightbox="true" |
| 98 | +file="/images/incubation/arm-support/logs-arm.png" |
| 99 | +url="/images/incubation/arm-support/logs-arm.png" |
| 100 | +alt="Running Unit tests" |
| 101 | +caption="Running Unit tests" |
| 102 | +max-width="60%" |
| 103 | +%} |
| 104 | + |
| 105 | +Once the pipeline is finished you will see the Docker image stored in the[default Docker Registry]({{site.baseurl}}/docs/docker-registries/external-docker-registries/#the-default-registry): |
| 106 | + |
| 107 | +{% include |
| 108 | +image.html |
| 109 | +lightbox="true" |
| 110 | +file="/images/incubation/arm-support/arm-images.png" |
| 111 | +url="/images/incubation/arm-support/arm-images.png" |
| 112 | +alt="Private Registry for ARM docker images" |
| 113 | +caption="Private Registry for ARM docker images" |
| 114 | +max-width="60%" |
| 115 | +%} |
| 116 | + |
| 117 | +You can also launch it as a[demo environment]({{site.baseurl}}/docs/quick-start/ci-quick-start/on-demand-environments/). |
| 118 | + |
| 119 | +{% include |
| 120 | +image.html |
| 121 | +lightbox="true" |
| 122 | +file="/images/incubation/arm-support/arm-environment.png" |
| 123 | +url="/images/incubation/arm-support/arm-environment.png" |
| 124 | +alt="Launching Docker ARM images" |
| 125 | +caption="Launching Docker ARM images" |
| 126 | +max-width="60%" |
| 127 | +%} |
| 128 | + |
| 129 | +In summary, the workflow for ARM images is exactly the same as the usual Linux/x86 images. |
| 130 | + |
| 131 | +##Related articles |
| 132 | +[Windows container support]({{site.baseurl}}/docs/incubation/windows-beta/) |
| 133 | +[macOS and iOS builds]({{site.baseurl}}/docs/incubation/osx-ios-builds/) |
| 134 | + |