This image provides bare metal (arm-none-eabi-gxx) compiler collection as a container. The binaries are taken directly from here without any modifications.
The repo of the project can be found here.
Bellow is the list with the supported tags as links to the Dockerfile of the version.
10.2.1
,10.2
,10
,10-2020-q4-major
9.2.1
,9.2
,9
,9-2019-q4-major
8.2.1
,8.2
,8
,8-2018-q4-major
7.2.1
,7.2
,7
,7-2017-q4-major
The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project that supports various programming languages. GCC is a key component of the GNU toolchain. The Free Software Foundation (FSF) distributes GCC under the GNU General Public License (GNU GPL). GCC has played an important role in the growth of free software, as both a tool and an example.
see: https://en.wikipedia.org/wiki/GNU_Compiler_Collection
The GNU Arm Embedded Toolchain is a ready-to-use, open-source suite of tools for C, C++ and assembly programming. The GNU Arm Embedded Toolchain targets the 32-bit Arm Cortex-M, and Arm Cortex-R processor families. The GNU Arm Embedded Toolchain includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux, and Mac OS X operating systems.
The most straightforward way to use this image is to use a gcc container as both the build and runtime environment. In your Dockerfile, writing something along the lines of the following will compile and run your project:
FROM hoo2/gcc-arm-none-eabi:latest
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN gcc -o myapp main.c
CMD ["./myapp"]
Then, build and run the Docker image:
$ docker build -t appImage .
$ docker run -it --rm --name my-running-app appImage
There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp hoo2/gcc-arm-none-eabi:7.2 arm-none-eabi-gcc -o myapp myapp.c
This will add your current directory, as a volume, to the container, set the working directory to the volume, and run the command arm-none-eabi-gcc -o myapp myapp.c
. This tells gcc to compile the code in myapp.c and output the executable to myapp.
if you have a Makefile, you can instead run the make command inside your container
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp hoo2/gcc-arm-none-eabi make
- Add support for other platforms besides linux_x64