{"id":15679215,"url":"https://github.com/carlosperate/docker-microbit-toolchain","last_synced_at":"2025-05-07T09:27:54.746Z","repository":{"id":69432354,"uuid":"300082968","full_name":"carlosperate/docker-microbit-toolchain","owner":"carlosperate","description":"Docker image with the BBC micro:bit C/C++ toolchain 🐳","archived":false,"fork":false,"pushed_at":"2022-06-08T22:52:42.000Z","size":32,"stargazers_count":12,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T08:39:22.280Z","etag":null,"topics":["docker","docker-image","microbit","toolchain"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlosperate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-30T22:55:10.000Z","updated_at":"2023-06-26T10:06:44.000Z","dependencies_parsed_at":"2023-09-15T22:15:31.877Z","dependency_job_id":null,"html_url":"https://github.com/carlosperate/docker-microbit-toolchain","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fdocker-microbit-toolchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fdocker-microbit-toolchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fdocker-microbit-toolchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fdocker-microbit-toolchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosperate","download_url":"https://codeload.github.com/carlosperate/docker-microbit-toolchain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252850279,"owners_count":21813936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","microbit","toolchain"],"created_at":"2024-10-03T16:27:01.964Z","updated_at":"2025-05-07T09:27:54.724Z","avatar_url":"https://github.com/carlosperate.png","language":"Shell","readme":"# Docker micro:bit Toolchain\n\nDocker image with the micro:bit toolchain.\n\n![docker-microbit](https://user-images.githubusercontent.com/4189262/99010611-3445f000-2542-11eb-90d8-0983d37de762.png)\n\nUseful to be able to compile C/C++ programmes using the DAL or CODAL micro:bit\nruntime, which includes projects like MicroPython. It can also be used to build\nthe DAPLink project for the micro:bit interface chip.\n\nAlso includes a Docker image ready to be used with\n[GitHub Codespaces](https://github.com/features/codespaces) and build your\nmicro:bit projects on the cloud.\n\n![codespaces](https://user-images.githubusercontent.com/4189262/99011128-48d6b800-2543-11eb-89a7-738ff64e379a.png)\n\n\n## How to use this Docker image to build your micro:bit project\n\nThe Docker image is hosted in the\n[GitHub Container Registry](https://github.blog/2020-09-01-introducing-github-container-registry/)\nand can be fetch with this command:\n\n```\ndocker pull ghcr.io/carlosperate/microbit-toolchain:latest\n```\n\nYou can find more info about the image here:\nhttps://github.com/carlosperate/docker-microbit-toolchain/pkgs/container/microbit-toolchain\n\nYou can run this Docker image to build your project with a command like this:\n\n```\ndocker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest \u003cbuild_command\u003e\n```\n\nWhere:\n- `-v $(pwd):/home` flag mounts your PC current working directory as a volume\n  inside the docker container `/home` path, which is also the container default\n  working directory\n- `--rm` flag will clean up the container created for the build\n- `\u003cbuild_command\u003e` should be replaced with whatever build command is needed for\n  your project. For example, for a CODAL project that would be `python build.py`\n  ([info in their README](https://github.com/lancaster-university/microbit-v2-samples/tree/v0.2.11#building))\n\n### Example: DAL (V1 C++ Samples)\n\nThe build steps from this example have been obtained from the\n[project README](https://github.com/lancaster-university/microbit-samples/blob/v2.1.1/README.md).\n\n```bash\n# Clone the repository\n$ git clone https://github.com/lancaster-university/microbit-samples\n$ cd microbit-samples\n# Build it using this docker image\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yotta build\n```\n\n### Example: CODAL (V2 C++ Samples)\n\nThe build steps from this example have been obtained from the\n[project README](https://github.com/lancaster-university/microbit-v2-samples/blob/v0.2.11/README.md).\n\n```bash\n# Clone the repository\n$ git clone https://github.com/lancaster-university/microbit-v2-samples.git\n$ cd microbit-v2-samples\n# Build it using this docker image\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest python build.py\n```\n\n### Example: MicroPython V1\n\nThe build steps from this example have been obtained from the\n[project README](https://github.com/bbcmicrobit/micropython/blob/v1.0.1/README.md).\n\n```bash\n# Clone the repository\n$ git clone https://github.com/bbcmicrobit/micropython.git\n$ cd micropython\n# First prepare the project, this initial docker command only has to be run once\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yt target bbc-microbit-classic-gcc-nosd@https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc-nosd\n# Now we are ready to build it\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest make all\n```\n\n### Example: MicroPython V2\n\nThe build steps from this example have been obtained from the\n[project README](https://github.com/microbit-foundation/micropython-microbit-v2/blob/v2.0.0-beta.1/README.md).\n\n```bash\n# Clone the repository\n$ git clone https://github.com/microbit-foundation/micropython-microbit-v2.git\n$ cd micropython-microbit-v2\n$ git submodule update --init\n# First we prepare the project, this initial docker command only has to be run once\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest make -C lib/micropython/mpy-cross\n# Now we are ready to build using the Makefile in the src folder\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest make -C src\n```\n\n### Example: DAPLink for micro:bit V2\n\nThe build steps from this example have been obtained from the\n[project developer's guide](https://github.com/ARMmbed/DAPLink/blob/develop/docs/DEVELOPERS-GUIDE.md).\n\n```bash\n# Clone the repository\n$ git clone https://github.com/mbedmicro/DAPLink\n$ cd DAPLink\n# Install the Python dependencies in a venv saved in the project directory\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest bash -c \"pip install virtualenv \u0026\u0026 virtualenv venv \u0026\u0026 source venv/bin/activate \u0026\u0026 pip install -r requirements.txt\"\n# Activate the Python virtual environment and run the build script\n$ docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest bash -c \"source venv/bin/activate \u0026\u0026 python tools/progen_compile.py -t make_gcc_arm kl27z_microbit_if\"\n```\n\n\n## How to use this Docker Image with GitHub Codespaces\n\nThis section of the docs is still a WIP.\n\n\n## Other General Docker Instructions\n\n### Build docker image\n\nBuild the docker image:\n\n```\ndocker build -t \"microbit-toolchain\" .\n```\n\n### Run a bash session\n\nRun a bash session (launches a new container) from an existing docker image:\n\n```\ndocker run --name microbit-toolchain-container -it --entrypoint /bin/bash microbit-toolchain\n```\n\n### Copy files from docker to host\n\n```\ndocker cp microbit-toolchain-container:/home/artefacts .\n```\n","funding_links":[],"categories":["🛠️ Programming Tools"],"sub_categories":["🎓 Machine Learning Resources \u0026 Projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosperate%2Fdocker-microbit-toolchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosperate%2Fdocker-microbit-toolchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosperate%2Fdocker-microbit-toolchain/lists"}