├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.5-alpine 2 | MAINTAINER Alexey Diyan 3 | 4 | ENV MYCLI_VERSION 1.5.2 5 | # py-setproctitle workaround: https://github.com/dvarrazzo/py-setproctitle/issues/44 6 | RUN set -x \ 7 | && buildDeps='build-base openssl' \ 8 | && apk add --update $buildDeps \ 9 | && wget -O /tmp/py-setproctitle.tar.gz https://github.com/dvarrazzo/py-setproctitle/archive/version-1.1.9.tar.gz \ 10 | && tar -xzvf /tmp/py-setproctitle.tar.gz -C /tmp \ 11 | && cd /tmp/py-setproctitle-version-1.1.9/ \ 12 | && sed -i 's:#include ://#include :' ./src/spt_status.c \ 13 | && python setup.py install \ 14 | && pip install mycli==${MYCLI_VERSION} \ 15 | && apk del $buildDeps \ 16 | && rm -rf /var/cache/apk/* /tmp/py-setproctitle* 17 | 18 | ENTRYPOINT ["/usr/local/bin/mycli"] 19 | CMD ["--help"] 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Alexey Diyan 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 | # mycli-docker 2 | mycli in a tiny Docker image powered by Alpine Linux 3 | 4 | # How to use this image 5 | 6 | Print help: 7 | 8 | ```bash 9 | docker run --rm diyan/mycli --help 10 | ``` 11 | 12 | Run MySQL server if you don't have it: 13 | 14 | ```bash 15 | docker run -d --name=mysql \ 16 | -p 3306:3306 \ 17 | -e MYSQL_ROOT_PASSWORD=secret \ 18 | mysql:5.7 19 | ``` 20 | 21 | Run mycli: 22 | 23 | ```bash 24 | docker run --rm -ti --name=mycli \ 25 | --link=mysql:mysql \ 26 | diyan/mycli \ 27 | --host=mysql \ 28 | --database=mysql \ 29 | --user=root \ 30 | --password=secret 31 | ``` 32 | --------------------------------------------------------------------------------