Skip to content

Commit

Permalink
Merge pull request project-chip#11 from lukgni/mbed-devenv-integration
Browse files Browse the repository at this point in the history
Add Mbed-Os Dockerfile definition
  • Loading branch information
Lukasz Gniadzik committed Feb 4, 2021
2 parents 1073ccf + 1ce8cfc commit 13bbfc8
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 2 deletions.
57 changes: 57 additions & 0 deletions integrations/docker/images/chip-build-mbed-os/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ARG VERSION=latest
FROM connectedhomeip/chip-build:${VERSION}

# ------------------------------------------------------------------------------
# Install system tools via apt
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy \
python3-setuptools \
python3-usb \
software-properties-common \
build-essential \
astyle \
mercurial \
&& rm -rf /var/lib/apt/lists \
&& : # last line

# ------------------------------------------------------------------------------
# Install Mbed-OS sources
RUN set -x \
&& (mkdir -p /opt/mbed-os \
&& cd /opt/mbed-os \
&& wget --progress=dot:giga https://github.com/ARMmbed/mbed-os/archive/mbed-os-6.6.0.tar.gz \
&& tar --strip-components=1 -xzf mbed-os-6.6.0.tar.gz \
&& rm mbed-os-6.6.0.tar.gz) \
&& : # last line

# ------------------------------------------------------------------------------
# Install Python modules
RUN set -x \
&& pip3 install --no-cache-dir -U mbed-cli mbed-tools \
&& pip3 install --no-cache-dir -r /opt/mbed-os/requirements.txt \
&& : # last line

# ------------------------------------------------------------------------------
# Install ARM Toolchain (gcc-arm-none-eabi-9-2019-q4)
RUN set -x \
&& (mkdir -p /opt/mbed-os-toolchain \
&& cd /opt/mbed-os-toolchain \
&& wget --progress=dot:giga https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \
&& tar -xjf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \
&& rm gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \
&& : ) # last line

# ------------------------------------------------------------------------------
# Configure mbed build system
RUN set -x \
&& mbed config -G GCC_ARM_PATH /opt/mbed-os-toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/ \
&& mbed toolchain -G -s GCC_ARM \
&& : # last line

# ------------------------------------------------------------------------------
# Configure environment variables
ENV MBED_GCC_ARM_PATH=/opt/mbed-os-toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/
ENV MBED_OS_PATH=/opt/mbed-os/

ENV PATH="${PATH}:${MBED_GCC_ARM_PATH}"
1 change: 1 addition & 0 deletions integrations/docker/images/chip-build-mbed-os/build.sh
1 change: 1 addition & 0 deletions integrations/docker/images/chip-build-mbed-os/run.sh
1 change: 1 addition & 0 deletions integrations/docker/images/chip-build-mbed-os/version
5 changes: 5 additions & 0 deletions integrations/docker/images/chip-build-vscode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM connectedhomeip/chip-build-nrf-platform:${VERSION} AS nrf
FROM connectedhomeip/chip-build-efr32:${VERSION} AS efr32
FROM connectedhomeip/chip-build-android:${VERSION} AS android
FROM connectedhomeip/chip-build-esp32-qemu:${VERSION} as esp32
FROM connectedhomeip/chip-build-mbed-os:${VERSION} AS mbedos
FROM connectedhomeip/chip-build:${VERSION}
COPY --from=esp32 /opt/espressif/esp-idf /opt/espressif/esp-idf
COPY --from=esp32 /opt/espressif/tools /opt/espressif/tools
Expand All @@ -13,6 +14,8 @@ COPY --from=nrf /opt/nrfconnect/sdk-nrf /opt/NordicSemiconductor/nrfconnect
COPY --from=efr32 /opt/SiliconLabs/sdk_support /opt/SiliconLabs/sdk_support
COPY --from=android /opt/android/sdk /opt/android/sdk
COPY --from=android /opt/android/android-ndk-r21b /opt/android/android-ndk-r21b
COPY --from=mbedos /opt/mbed-os /opt/mbed-os
COPY --from=mbedos /opt/mbed-os-toolchain/ /opt/mbed-os-toolchain/
ENV IDF_PATH=/opt/espressif/esp-idf/
ENV IDF_TOOLS_PATH=/opt/espressif/tools
ENV QEMU_ESP32_DIR=/opt/espressif/qemu
Expand All @@ -26,4 +29,6 @@ ENV EFR32_SDK_ROOT=/opt/SiliconLabs/sdk_support
ENV EFR32_BOARD=BRD4161A
ENV ANDROID_HOME=/opt/android/sdk
ENV ANDROID_NDK_HOME=/opt/android/android-ndk-r21b
ENV MBED_GCC_ARM_PATH=/opt/mbed-os-toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/
ENV MBED_OS_PATH=/opt/mbed-os/
ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env
10 changes: 9 additions & 1 deletion integrations/docker/images/chip-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN set -x \
clang \
clang-format \
clang-tidy \
cmake \
curl \
flex \
g++ \
Expand Down Expand Up @@ -64,6 +63,15 @@ RUN set -x \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line

# Cmake (Mbed OS requires >=3.19.0-rc3 version which is not available in Ubuntu 20.04 repository)
RUN set -x \
&& (cd /tmp \
&& wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh \
&& sh cmake-3.19.3-Linux-x86_64.sh --exclude-subdir --prefix=/usr/local \
&& rm -rf cmake-3.19.3-Linux-x86_64.sh) \
&& exec bash \
&& : # last line

# Python 2 and PIP
RUN set -x \
&& apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.18
0.5.0

0 comments on commit 13bbfc8

Please sign in to comment.