Let's build your project with arm-none-eabi-gcc
in a docker container.
- Based on
ubuntu:20.04
git
andmake
are pre-installed- Environment variables
TZ
: Timezone, default isAsia/Taipei
USER_NAME
: User nameUSER_UID
: User IDUSER_GID
: Group ID
# Running as root user
GCC_VERSION=latest \
HOST_TZ=$(cat /etc/timezone) \
docker run -it --rm \
-e TZ=$HOST_TZ \
-v "$(pwd)":/share \
-w /share \
jafee201153/arm-none-eabi-gcc:$GCC_VERSION /bin/bash
# Running as non-root user
GCC_VERSION=latest \
HOST_TZ=$(cat /etc/timezone) \
USER_NAME=$(whoami) \
USER_UID=$(id -u $USER_NAME) \
USER_GID=$(id -g $USER_NAME) \
docker run -it --rm \
-e TZ=$HOST_TZ \
-e USER_NAME=$USER_NAME \
-e USER_UID=$USER_UID \
-e USER_GID=$USER_GID \
-v "$(pwd)":/home/$USER_NAME/share \
-w /home/$USER_NAME/share \
jafee201153/arm-none-eabi-gcc:$GCC_VERSION /bin/bash
# Build the project
GCC_VERSION=latest \
HOST_TZ=$(cat /etc/timezone) \
USER_NAME=$(whoami) \
USER_UID=$(id -u $USER_NAME) \
USER_GID=$(id -g $USER_NAME) \
docker run -it --rm \
-e TZ=$HOST_TZ \
-e USER_NAME=$USER_NAME \
-e USER_UID=$USER_UID \
-e USER_GID=$USER_GID \
-v "$(pwd)":/home/$USER_NAME/share \
-w /home/$USER_NAME/share \
jafee201153/arm-none-eabi-gcc:$GCC_VERSION /bin/bash \
-c "make clean && make all"
If you encounter any issues or have suggestions, please open an issue on our GitHub repository.