├── .travis.yml ├── Dockerfile ├── LICENSE └── README.md /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: 'required' 2 | 3 | services: 4 | - 'docker' 5 | 6 | script: 7 | - 'docker build -t $DOCKER_USERNAME/micropython-linux:$TRAVIS_BRANCH .' 8 | 9 | after_success: 10 | - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD 11 | - docker push $DOCKER_USERNAME/micropython-linux:$TRAVIS_BRANCH 12 | 13 | # don't notify me when things fail 14 | notifications: 15 | email: false 16 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y build-essential libffi-dev git pkg-config python3 && \ 5 | rm -rf /var/lib/apt/lists/* && \ 6 | git clone https://github.com/micropython/micropython.git && \ 7 | cd micropython && \ 8 | cd mpy-cross && \ 9 | make && \ 10 | cd .. && \ 11 | cd ports/unix && \ 12 | make submodules && \ 13 | make && \ 14 | make test && \ 15 | make install && \ 16 | apt-get purge --auto-remove -y build-essential libffi-dev git pkg-config python3 && \ 17 | cd ../../.. && \ 18 | rm -rf micropython 19 | 20 | CMD ["/usr/local/bin/micropython"] 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mitchell Currie 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-micropython-linux 2 | Docker image that comes loaded with the unix (linux in this case) port of micropython. 3 | 4 | #### Why use this? Simple: 5 | 6 | * Running automated tests against libraries intended for micropython (you *can* use python3, but there are edge cases). 7 | * Experimenting with micropython without any complexity of building yourself or overhead of buying a board first. 8 | * There wasn't an existing and well-maintained image. 9 | 10 | The image is based off the official Debian-slim (stretch) because it's fairly slim (not as slim as alpine, but that can be a headache to build). 11 | 12 | #### Getting Started 13 | 14 | Providing you have access to Docker, you can run the latest version quite easily by: 15 | 16 | docker run -it mitchins/micropython-linux 17 | MicroPython v1.9.4-403-g81e320ae on 2018-07-21; linux version 18 | Use Ctrl-D to exit, Ctrl-E for paste mode 19 | >>> ^C 20 | 21 | Tags are available on the Docker Hub listing 22 | 23 | If you check the Dockerfile, you will see it starts up micropython automatically which is stored in /usr/local/bin/micropython 24 | 25 | To install something else, you can: 26 | 27 | # micropython -m upip install micropython-unittest 28 | Installing to: /root/.micropython/lib/ 29 | Warning: pypi.org SSL certificate is not validated 30 | Installing micropython-unittest 0.3.2 from https://files.pythonhosted.org/packages/9a/42/41057b8da94414a17f7028ee08035c3d945befebddc76d58988067ddaf0f/micropython-unittest-0.3.2.tar.gz 31 | 32 | That's about it, the goal is to maintain the latest and stable tagged versions so regressions can be tested as needed, or experimented features accessed. 33 | --------------------------------------------------------------------------------