简体   繁体   English

如何设置 docker 容器以在 Nordic nRF5 SDK 上进行开发?

[英]How can I setup a docker container for developing on the Nordic nRF5 SDK?

I'd like to setup a docker container and share it with my co-workers so we all don't have to setup development environments individually.我想设置一个 docker 容器并与我的同事共享,这样我们就不必单独设置开发环境。

Note that this does not include saving the container as an image and uploading to DockerHub (search around for that part).请注意,这不包括将容器保存为图像并上传到 DockerHub(搜索该部分)。 Its also worth noting that this set of instructions would be a good start for creating a "dockerfile" which would automatically run all of these commands to build up this container on-demand.还值得注意的是,这组指令将是创建“dockerfile”的良好开端,它将自动运行所有这些命令以按需构建此容器。

    docker pull ubuntu
    docker run --privileged=true -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v /dev/bus/usb:/dev/bus/usb ubuntu

        // As root in the docker container:
    apt-get update
    apt-get install vim vifm ssh sshd iproute2 iputils-ping sshfs build-essential dos2unix git usbutils
    adduser mydevuser
    /etc/init.d/ssh start
    ip a

        // As mydevuser user in the docker container:
    - Download and unzip gcc compilers from ARM (gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2)
    - Download and unzip nRF5SDK (nRF5SDK160098a08e2.zip)
    - Download and unzip soft device (s113nrf52701.zip)
    - Download and unzip command line tools (nRF-Command-Line-Tools_10_4_1_Linux-amd64.tar.gz)
        // Configure for our compiler, here is my updated GNU_INSTALL_ROOT
    ~/nRF5SDK/components/toolchain/gcc ..) head Makefile.posix
                GNU_INSTALL_ROOT ?= /home/mydevuser/gcc/gcc-arm-none-eabi-8-2019-q3-update/bin/
        // Now lets compile some examples
    ~/nRF5SDK/external/micro-ecc/nrf52hf_armgcc/armgcc ..) make
    ~/nRF5SDK/examples/dfu/secure_bootloader/pca10100_s113_ble_debug/armgcc ..) make
    ~/nRF5SDK/examples/peripheral/spi/pca10056/blank/armgcc ..) make

        // As root in the docker container:
    mv /home/mydevuser/cli_nrf/mergehex /opt/
    mv /home/mydevuser/cli_nrf/nrfjprog/ /opt/
    ln -s /opt/nrfjprog/nrfjprog /usr/local/bin/nrfjprog
    ln -s /opt/mergehex/mergehex /usr/local/bin/mergehex
    cp -pv /home/mydevuser/cli_nrf/JLink_Linux_V650b_x86_64/libjlinkarm* /lib/x86_64-linux-gnu/

        // As root in the docker container:
        // Load the firmware over USB to the dev board:
    nrfjprog -f NRF52 --program nrf52840_xxaa.hex --chiperase --log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM