<jupyter_start><jupyter_text>Build Rocket Docker ImageThis instruction describe how to build a Rocket image from its source code. You can also choose to deploy pre-built Rocket image with LVA. To do so, please skip the instructions below and move to the next section on [configuring lines of interest](./line_configuration.md).  Get global variablesWe will need to read the previously stored variables and login to ACR created in [create_azure_services.ipynb](../../../utilities/video-analysis/notebooks/common/create_azure_services.ipynb) for image uploading.<jupyter_code>import sys
sys.path.append('../../../utilities/video-analysis/notebooks/common')

from env_variables import *
!sudo docker login --username $acrUserName --password $acrPassword  $acrServiceFullName<jupyter_output><empty_output><jupyter_text>Define containerImageName.<jupyter_code>containerImageName = "rocket-custom"
set_key(envPath, "CONTAINER_IMAGE_NAME", containerImageName)<jupyter_output><empty_output><jupyter_text>Build on LinuxRocket is built using .NET Core, and we recommend running it as a [Docker](https://www.docker.com/) container is recommended. Below we use Ubuntu 18.04 as an example to walk through the steps of building Rocket docker image and run it with GPU acceleration.   Prerequisites  * [Visual Studio Code](https://code.visualstudio.com/) is recommended IDE for Rocket on Linux.* Make sure [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/) are installed. Otherwise please follow instructions in [requirements.md](../../../utilities/video-analysis/notebooks/common/requirements.md) to install them.   Build your own Rocket image on Linux  * Git clone the [repository](https://github.com/Azure/live-video-analytics/).* Run `docker build` to [build](https://docs.docker.com/engine/reference/commandline/build/) Rocket image using `Dockerfile` in the root directory of the Rocket.<jupyter_code>os.chdir('../csharp')
!sudo docker build -t $acrServiceFullName/$containerImageName -f Dockerfile .<jupyter_output><empty_output><jupyter_text>* Push Rocket image to the Azure Container Registry that you created in previous steps for Rocket to run on the IoT Edge Device. You can also choose to push it to a different cloud repository (e.g., docker hub).<jupyter_code>!sudo docker push $acrServiceFullName/$containerImageName<jupyter_output><empty_output><jupyter_text>Build on Windows  Prerequisites  * [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) (>= VS 2017) is recommended IDE for Rocket on Windows 10. * Git for Windows (https://git-scm.com/download/win).* Docker Desktop for Windows (https://docs.docker.com/docker-for-windows/install/). Please make sure it's set to `Linux containers` in Settings.  Build your own Rocket image on Windows* Git clone the [repository](https://github.com/Azure/live-video-analytics).* Build docker image in Windows PowerShell in the root directory of Rocket.<jupyter_code>os.chdir('../csharp')
!docker build -t $acrServiceFullName/$containerImageName -f Dockerfile .<jupyter_output><empty_output><jupyter_text>* Push docker image.<jupyter_code>!docker push $acrServiceFullName/$containerImageName<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10638948333842861, 'fraction_numerical': 0.003362885967594008, 'mean_word_length': 5.623481781376518, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 10, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '659172', 'license': 'MIT', 'n_tokens_mistral': 993, 'n_tokens_neox': 930, 'n_words': 300, 'path': 'ref-apps/rocket/notebooks/build_rocket_image.ipynb', 'repo_name': 'fvneerden/live-video-analytics', 'size': '3271'}