{"id":18991387,"url":"https://github.com/aziascreations/docker-circuitpython-mpycross","last_synced_at":"2026-05-16T15:36:01.175Z","repository":{"id":170806298,"uuid":"647003002","full_name":"aziascreations/Docker-CircuitPython-MpyCross","owner":"aziascreations","description":"Containerized version of CircuitPython's mpy-cross that automatically compiles scripts.","archived":false,"fork":false,"pushed_at":"2023-05-30T00:49:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T14:45:17.183Z","etag":null,"topics":["circuitpython","mpy-cross","python"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/aziascreations/cpy-mpy-cross","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aziascreations.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-29T21:04:50.000Z","updated_at":"2023-05-30T00:21:32.000Z","dependencies_parsed_at":"2023-07-23T14:16:34.428Z","dependency_job_id":null,"html_url":"https://github.com/aziascreations/Docker-CircuitPython-MpyCross","commit_stats":null,"previous_names":["aziascreations/docker-circuitpython-mpycross"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziascreations%2FDocker-CircuitPython-MpyCross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziascreations%2FDocker-CircuitPython-MpyCross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziascreations%2FDocker-CircuitPython-MpyCross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziascreations%2FDocker-CircuitPython-MpyCross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aziascreations","download_url":"https://codeload.github.com/aziascreations/Docker-CircuitPython-MpyCross/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240002434,"owners_count":19732195,"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":["circuitpython","mpy-cross","python"],"created_at":"2024-11-08T17:13:42.883Z","updated_at":"2026-04-14T11:30:16.846Z","avatar_url":"https://github.com/aziascreations.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker - CircuitPython's mpy-cross\nContainerized version of [CircuitPython](https://github.com/adafruit/circuitpython)'s version of mpy-cross that\nautomatically compiles any script you give it.\n\n## Usage\nThese examples assume you are using `./input` and `./output` as your input and output folders.\n\n### Available versions\n| Image \u0026 Tag                          | CircuitPython's release tag                                           | MPY Version |\n|--------------------------------------|-----------------------------------------------------------------------|-------------|\n| `aziascreations/cpy-mpy-cross:8.1.0` | [8.1.0](https://github.com/adafruit/circuitpython/releases/tag/8.1.0) | 5           |\n\nAny tag with the same *MPY version* should output the same files, or at least interoperable ones.\n\nAll these images are also available for the following architectures:\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`linux/amd64`, `linux/arm64/v8`\n\n### Docker CLI\nSimply run the following command:\n```bash\ndocker run \\\n    -v ./input:/data/input \\\n    -v ./output:/data/output \\\n    -e PUID=1000 \\\n    -e PGID=1000 \\\n    -e MPY_CROSS_EXTRA_ARGS=-O1 \\\n    aziascreations/cpy-mpy-cross:8.1.0\n```\n\n### Docker-compose\nPrepare your `docker-compose.yml` file like so:\n```yaml\nversion: \"3\"\n\nservices:\n  mpy-cross-cpy:\n    container_name: mpy-cross-cpy\n    image: aziascreations/cpy-mpy-cross:8.1.0\n    environment:\n      # Custom UID and GID used when setting the ownership of the output files.\n      # If not defined, UID=0 and GID=0 will be used.\n      - PUID=1000\n      - PGID=1000\n      # Custom launch arguments passed as-is to `mpy-cross` for each file.\n      # If only \"-h\" or \"--help\" is used, only the usage text will be shown.\n      - \"MPY_CROSS_EXTRA_ARGS=-O1\"\n    volumes:\n      - ./input:/data/input\n      - ./output:/data/output\n    restart: \"no\"\n```\n\nAnd run the following command:\n```bash\ndocker-compose up\n```\n\n### Environment variables\n| Variable               | Description                                                           |\n|------------------------|-----------------------------------------------------------------------|\n| `PUID`                 | Custom UID to which the generated folders and files will be chown'ed. |\n| `PGID`                 | Custom GID to which the generated folders and files will be chown'ed. |\n| `MPY_CROSS_EXTRA_ARGS` | Custom launch arguments passed as-is to `mpy-cross` for each file.\u003cbr\u003eIf only \"-h\" or \"--help\" is used, only the usage text will be shown. |\n\n## Building Locally\n\n### Requirements\n* ~6 GB of HDD space  *(Final image is \u003c16 MiB)*\n* ~500 MB of RAM\n* A stable internet connection  *(See Dockerfile comments)*\n\n### Cloning\n```bash\ngit clone https://github.com/aziascreations/Docker-CircuitPython-MpyCross.git\ncd Docker-CircuitPython-MpyCross\n```\n\n### Customization\nIf you want a specific or different version of CircuitPython's repository you will need to modify\nthe `CIRCUITPYTHON_GIT_TAG` build argument in [docker-compose.yml](docker-compose.yml).\n\n### Building the image\nFirstly, run the following command:\n```\ndocker-compose up --build\n```\n\nFinally, wait for it to finish downloading and compiling everything.\n\nThis step can take a **long** time, here are some real-world examples:\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026#126;10-12 minutes on an Intel i5-3470  *(Ubuntu 22.04.2 LTS x86_64)*\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026#126;? minutes on a Rockchip RK3399  *(Armbian 23.02.2 aarch64)*\n\n### Failures\nIf you see an error message stating that `mpy-cross` cannot be compiled because of a missing module or dependency, you'll\nneed to restart the building process.\n\nThis is a not-so-uncommon issue caused by one of the steps failing silently for whatever reason when it cannot download\nsomething in the `make fetch-submodules` command.\n\nOn my end, I get a ~15% failure rate at best and a ~75% one on bad days.\u003cbr\u003e\nMy ISP is partly to blame with its frequent \"micro cut-offs\", but having to re-run the aforementionned command 20+\ntimes to finally have a \"complete\" repo shouldn't have to be a solution, ever.\n\n## License\nThe [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml) files are licensed under the [Unlicense](LICENSE) license.\n\nThis license does not apply to mpy-cross as it is licensed under the [MIT License](LICENSE_CircuitPython).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faziascreations%2Fdocker-circuitpython-mpycross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faziascreations%2Fdocker-circuitpython-mpycross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faziascreations%2Fdocker-circuitpython-mpycross/lists"}