Docker image for AVR development
This image contains all the dependencies you need for AVR development.
- Make
- CppUTest
- gcc
- avr-gcc
docker build -t rubberduck/avr .
This command will run the container and mount the current working directory to the working directory of the container. Mounting the current container means we leave the build artifacts behind on the host machine.
docker run --rm -it -v ${PWD}:/mount rubberduck/avr bash
Once inside the container, just run your makefile like you would if you had the dependencies installed on your local machine.
make check
make
# etc.
The container has avrdude installed and a default conf file located in /root/.avrduderc
.
By default, it points to the /dev/ttyUSB0
port.
docker run --rm -it --device /dev/ttyUSB0 -v ${PWD}:/mount rubberduck/avr bash
If you need to use a differenc avrdude conf file, you can mount it in like this.
docker run --rm -it --device /dev/someOtherTty -v ${PWD}:/mount -v someOtherAvrdude.conf:/root/.avrduderc rubberduck/avr bash
Accessing the host's USB ports can be difficult on non-Linux operating systems. You need to use a virtual machine to host the docker daemon.
See this blog post for instructions on accessing USB ports inside the container on Mac.
This image includes pkg-config. It can be leveraged in your makefile to locate the CppUTest includes and libs.
CPPFLAGS = $(shell pkg-config --cflags cpputest)
CXXFLAGS = -include CppUTest/MemoryLeakDetectorNewMacros.h
CFLAGS = -include CppUTest/MemoryLeakDetectorMallocMacros.h
LD_LIBRARIES = $(shell pkg-config --libs cpputest)