mirror of
https://github.com/lukstep/raspberry-pi-pico-docker-sdk.git
synced 2025-12-22 18:45:56 +03:00
65 lines
2.7 KiB
Markdown
65 lines
2.7 KiB
Markdown
[](https://github.com/lukstep/raspberry-pi-pico-docker-sdk/actions/workflows/sdk-ci.yml)
|
|
|
|
# Raspberry Pi Pico Docker SDK
|
|
|
|
A lightweight SDK environment for Raspberry Pi Pico in a Docker container.
|
|
|
|
## Pulling the Image from Docker Hub and Running
|
|
|
|
The latest image is available on [Docker Hub](https://hub.docker.com/repository/docker/lukstep/raspberry-pi-pico-sdk/general)
|
|
and can be used to run a container.
|
|
The following commands show how to run the container using the Docker Hub image:
|
|
|
|
```
|
|
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
|
|
docker exec -it pico-sdk /bin/sh
|
|
```
|
|
|
|
The directory from which the `docker run` command was executed will be mounted in the container at `/home/dev`.
|
|
After attaching to the SDK container, you can build your project by executing the following steps:
|
|
|
|
```
|
|
cd /home/dev
|
|
mkdir build
|
|
cd build
|
|
cmake .. && make -j4
|
|
```
|
|
|
|
## Building the Image and Running the Container
|
|
|
|
To build your own SDK image, clone this repository and run the following commands:
|
|
|
|
```
|
|
cd raspberry-pi-pico-docker-sdk
|
|
docker build . --tag pico-sdk
|
|
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev pico-sdk
|
|
docker exec -it pico-sdk /bin/sh
|
|
```
|
|
|
|
## Visual Studio Code as IDE for Raspberry Pi Pico Projects
|
|
|
|
You can use the SDK container with Visual Studio Code to create an IDE for Raspberry Pi Pico projects.
|
|
There are two solutions prepared: a new one using the Visual Studio Dev Containers extension and an old one with manual configuration.
|
|
|
|
### [Visual Studio Code Dev Container](https://code.visualstudio.com/docs/devcontainers/containers)
|
|
|
|
#### Prerequisites
|
|
|
|
To use the dev container, you need to have VSCode, Docker, and the VSCode extensions installed.
|
|
Follow [this](https://code.visualstudio.com/docs/devcontainers/tutorial#_prerequisites) guide for setup.
|
|
|
|
#### Using the Dev Container for Pico IDE
|
|
|
|
- Clone [pico-dev-container](https://github.com/lukstep/pico-dev-container/tree/main) repository.
|
|
- Open `pico-dev-container` folder in Visual Studio Code.
|
|
- In VSCode, click the button in the bottom left corner of VSCode and select: Reopen in Container...
|
|

|
|
- Build the project.
|
|
- Enjoy coding you Pico project with Intellisense.
|
|

|
|
|
|
### Manual configuration of VSCode as Pico IDE (old)
|
|
|
|
Refer [here](docs/vscode_manual_setup.md) for step-by-step instruction
|
|
|