- Introduction
- Installing Docker
- Installing Docker on the CHIP
- Creating the CHIP SDK Image
- Flashing the CHIP
- Resources
This repository contains the Dockerfiles and setup scripts necessary to build Docker images containing the CHIP SDK for Docker running on x64 systems as well as the CHIP. If you are new to Docker, you may be wondering what Docker is and why you would want to use it to flash your CHIP. From Docker's website:
Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.
Essentially, Docker allows us to flash the CHIP easily regardless of the host operating system. Additionally, Docker helps us avoid having to directly install new packages and software on our host system, and instead offers minimal virtual machines (called containers) which we can install the software onto and delete once we are done with them. Currently, the CHIP documentation uses Vagrant combined with full virtual machines to flash the CHIP. This process uses more overhead and therefore could slow down our system as well as use more HDD/SSD space :( Docker is a lightweight, cross platform solution to this!
Follow the install guide for your operating system here.
While it is still experimental, you can install Docker on your CHIP by SSHing into the CHIP and issuing the command curl -sSL https://github.com/DieterReuter/arm-docker-fixes/raw/master/002-fix-install-docker-on-chip-computer/apply-fix-002.sh | bash. You can follow the guide here for more detailed instructions.
- Once you have downloaded Docker, clone/download this repository (if you downloaded the .zip file, extract it).
- Open a terminal and
cdinto the CHIPDocker folder. - Next,
cdinto thex64folder. - Enter the following command to build the image:
docker build -t "chip-image" .(be sure that you add the period at the end; it's important). - Wait for the image to build (it could take a while).
- When the image has been successfully built, you should get the message:
Successfully built XXXXXXXXXXXX.
- Once you have downloaded Docker, clone/download this repository (if you downloaded the .zip file, extract it).
- Open a terminal and
cdinto the CHIPDocker folder. - Next,
cdinto thearmfolder. - Enter the following command to build the image:
docker build -t "chip-image" .(be sure that you add the period at the end; it's important). - Wait for the image to build (it could take a while).
- When the image has been successfully built, you should get the message:
Successfully built XXXXXXXXXXXX.
- Put your C.H.I.P in FEL mode and plug it into your computer.
- Now that we have our Docker image, let's create a container for the CHIP SDK. Run the following command in the terminal:
docker run -it --name chip --privileged -v /dev/bus/usb:/dev/bus/usb chip-image. - You should now be in the Docker container shell, you should see a prompt like:
root@XXXXXXXXXXXX:/#. - Now enter the command:
cd CHIP-toolsinto the Docker shell. - Now you can run any of the
chip-update-firmwarecommands found here to flash your C.H.I.P. - If all goes well, the C.H.I.P. should be detected and flashed properly. If the flash succeeded, you should see a message like this on completion:
FLASH VERIFICATION COMPLETE.
# # #
#########
### ###
# {#} #
### '%######
# #
### ###
########
# # #
CHIP is ready to roll!