在linux上使用vscode,docker和Dev containers进行开发;Using VS Code and Dev containers to Develop on Linux

  • 感谢您的分享
  • Dockerfile & devcontainer.json更新,解决时区同步问题,删除‘cmake’插件。

    Code: Select all

    FROM ubuntu:22.04
    RUN apt-get update && apt-get install -y tzdata
    ENV CONTAINER_TIMEZONE=Australia/Perth
    RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
    RUN apt-get install -y git ssh make gcc gcc-multilib g++-multilib module-assistant expect g++ gawk texinfo libssl-dev bison flex fakeroot cmake unzip gperf autoconf device-tree-compiler libncurses5-dev pkg-config bc python-is-python3 passwd openssl openssh-server openssh-client vim file cpio rsync usbutils adb
    RUN apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*

    Code: Select all

    {
        "name": "LuckfoxPico",
        "build": {
            "dockerfile": "Dockerfile"
        },
        "customizations": {
            "vscode": {
                "settings": {
                    "terminal.integrated.shell.linux": "/bin/bash"
                },
                "extensions": [ "Erol444.adb-files",
                                "ms-vscode.cpptools",
                                "ms-vscode.cpptools-extension-pack",
                                "ms-vscode.makefile-tools",
                                "ms-vscode.cmake-tools",
                                "ms-vscode.cpptools-themes"]
            }
        },
        "runArgs": ["--privileged","-v","/dev:/dev"],
        "containerEnv": {
            "SDK_PATH": "/workspaces/luckfox-pico",
            "LUCKFOX_SDK_PATH": "/workspaces/luckfox-pico",
            "BUILDROOT_PATH": "/workspaces/luckfox-pico/sysdrv/source/buildroot/buildroot-2023.02.6/output/host/arm-buildroot-linux-uclibcgnueabihf/sysroot",
            "LUCKFOX_INCLUDE_PATH": "${BUILDROOT_PATH}/usr/include",
            "LUCKFOX_LIB_PATH": "${BUILDROOT_PATH}/usr/lib",
            "CONTAINER_TIMEZONE": "Australia/Perth"
        },
        "postCreateCommand": "bash -c 'cd $SDK_PATH/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/ && source env_install_toolchain.sh' && git config --global user.email YOUREMAIL && git config --global user.name 'YOURNAME'"
    }