Project

General

Profile

Docker build environment

Docker images are used to provide a consistent/known environment in which we can run our builds.

Installing Docker (modern linux systems)

The open source docker engine is required when using critical link provided dockerfiles. Instructions for installing docker on various linux OK systems can be found at this link:

https://docs.docker.com/engine/install

Critical Link generally tests using Ubuntu hosts. There are instructions for installing on an older Ubuntu 18.04 image below.

MitySOM-AM57 SDK 06 application development image

Critical Link provides a dockerfile that can be used to build a docker image that supports developing ARM, DSP, and IPU applications for the AM57x within the docker framework. The image installs the necessary compiler tool chains (TI's linux SDK and RTOS SDK for the AM57x) and version 10.4 of Code Composer studio to support the SDK version 6.0 development. The MitySOM-AM57x yocto SDK is also installed. All of the tools are installed in a "/home/tools" folder on the VM.

Note: This image is not setup for building yocto images. Yocto builds should use the crops/poky image as outlined here: Linux_Kernel_Yocto_for_MitySOM-AM57X

The dockerfile can be built with the following instructions:

git clone https://support.criticallink.com/git/containers.git
cd containers/am57x
make

Once the docker image is build, you can invoke the docker environment with the following command while in your project directory area.

docker run -it --rm -v $PWD:/work -e LOCAL_USER_ID=$(id -u $USER) -v /sys:/sys:ro -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --privileged -v /dev/bus/usb:/dev/bus/usb mitysom_57x_sdk6_ubuntu:18.04 /bin/bash
Explanation of arguments:
  • -it run command in interactive mode
  • --rm cleans up container after command exits
  • -v $PWD:/work Volume mount the current working directory into the container at /work
  • -e LOCAL_USER_ID=$(id -u $USER) Sets a LOCAL_USER_ID environment variable to your user id, so that the entrypoint script can make sure your user id in the container matches your user id outside the container
  • -v /sys:/sys:ro -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix Sets up volume mounts to ensure code composer can launch an X11 gui from within the container
  • --privileged -v /dev/bus/usb:/dev/bus/usb Allow code compose to access usb devices such as jtag debugger so code can be loaded and debugged.
  • mitysom_57x_sdk6_ubuntu:18.04 This is the image name we created above
  • /bin/bash will put us at a bash prompt when the container launches.

The docker bash command line will open and use your current USER ID for file access and map the folder you launched the command in to "/work" on the docker machine.

Key paths:

/home/tools/ti/ti-processor-sdk-linux-am57xx-evm-06.03.00.106          -> TI linux processor SDK
/home/tools/ti/ccs1040/ccs                                             -> TI Code Composure installation folder
/home/tools/ti/ti-processor-sdk-rtos-am57xx-evm-06.03.00.106-Linux-x86 -> TI RTOS processor SDK (for DSP and IPU development)
/home/tools/mitysom-57x                                                 -> installation of the yocto SDK for the MitySOM-57x development kit reference image

The first time you run the docker, you must allow CCS to install references to the RTOS tool suite. This can be done by the following steps. Launch code composer:

user@8d6e192add78:/work$ /home/tools/ti/ccs1040/ccs/eclipse/ccstudio &

For the workspace, set the default to /work.

In code composure studio select Window->Preferences from the menu bar.

In the Preference dialog, select Code Composure Studio -> Products, and in the Product Discovery Path, add the following path:

/home/tools/ti/ti-processor-sdk-rtos-am57xx-evm-06.03.00.104-Linux-x86

then hit Apply and Close.

Shortly, you should see a pop-up with the following dialog. Click "select all" and then "Install".

Do not select "Restart". Instead, click "restart-later" and exit code composer normally and relaunch from the command-line.

To avoid doing these steps each time the docker image is run, you can take a snapshot of the state of the image by running the following command in a different host shell while the current docker image is running:

mikew@mikew-cyberpc:~/projects/containers/am57x$ docker ps
CONTAINER ID   IMAGE                                                             COMMAND                  CREATED          STATUS          PORTS     NAMES
8d6e192add78   mitysom_57x_sdk6_ubuntu:18.04                                    "/usr/local/bin/entr…"   11 minutes ago   Up 11 minutes             romantic_pasteur
mikew@mikew-cyberpc:~/projects/containers/am57x$ docker commit 8d6e192add78 mitysom_57x_sdk6_ubuntu:18.04

sha256:051c23064080f26117465a9f1f9a382bbc646bcbef14e2dcbe139ee4f8f17c81
mikew@mikew-cyberpc:~/projects/containers/am57x$

Note that the hash for the CONTAINER ID will be different that the above example.

This step can be redone if you customize the layer for your specific needs (e.g., add aliases or modify the ~user/.bashrc file, etc.).

Installing Docker on legacy Ubuntu 18.04+ 64-bit hosts

These instructions assume you are running Ubuntu Linux 18.04+ 64-bit
Note: Running these steps using a VM or Windows Subsystem for Linux may work but might result in some disk performance issues

  • Install docker: https://docs.docker.com/engine/install/ubuntu/
    $ sudo apt-get remove docker docker-engine docker.io containerd runc
    $ sudo apt-get update
    $ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    $ 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 install docker-ce docker-ce-cli containerd.io
    $ sudo docker run hello-world
    
    • Note: If you are running in a proxy environment, these commands will not work as-is. You will need to configure docker and possibly your OS to use your network proxy. Please confirm your version of Docker and then follow https://docs.docker.com/network/proxy/ for more information.
  • Allow your user to run docker commands https://docs.docker.com/engine/install/linux-postinstall/
    Warning: The docker group grants privileges equivalent to the root user
    $ sudo usermod -aG docker $USER
    $ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
    $ sudo chmod g+rwx "$HOME/.docker" -R
    $ newgrp docker 
    $ docker run hello-world
    $ sudo systemctl enable docker
    

LetsEncrypt cert error (September 30 2021)

If you are getting the following error:

fatal: unable to access 'https://git.linaro.org/toolchain/gcc.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

On September 30 2021, the original root certificate for LetsEncrypt expired. A replacement cert has been implemented for a while but systems that haven't been updated in the past year may fail to validate the certificate. This has affected the crops/poky docker images. An issue has been raised with them to have them rebuild the images but in the meantime we've (hopefully temporarily) rebuilt their images and are hosting them on GitHub.

https://github.com/jcormier/crops_poky

The updated docker command example:

docker run --rm -it -v $PWD:/work ghcr.io/jcormier/crops_poky:ubuntu-18.04 --workdir=/work /work/build.sh

Go to top
Add picture from clipboard (Maximum size: 1 GB)