using_docker.rst 1.6 KB
Newer Older
1
Using docker
L
update  
liutuo 已提交
2
=============
3

L
Liangliang He 已提交
4
Pull or build docker image
L
update  
liutuo 已提交
5
---------------------------
6

L
Liangliang He 已提交
7
MACE provides docker images with dependencies installed and also Dockerfiles for images building,
8
you can pull the existing ones directly or build them from the Dockerfiles.
L
Liangliang He 已提交
9
In most cases, the ``lite edition`` image can satisfy developer's basic needs.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

.. note::
    It's highly recommended to pull built images.

- ``lite edition`` docker image.

.. code:: sh

    # Pull lite edition docker image
    docker pull registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite
    # Build lite edition docker image
    docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite ./docker/mace-dev-lite

- ``full edition`` docker image (which contains multiple NDK versions and other dev tools).

.. code:: sh

    # Pull full edition docker image
    docker pull registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev
    # Build full edition docker image
    docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev ./docker/mace-dev

.. note::

    We will show steps with lite edition later.

L
update  
liutuo 已提交
36

37
Using the image
L
update  
liutuo 已提交
38
-----------------
39 40 41 42 43 44 45 46 47

Create container with the following command

.. code:: sh

    # Create a container named `mace-dev`
    docker run -it --privileged -d --name mace-dev \
               -v /dev/bus/usb:/dev/bus/usb --net=host \
               -v /local/path:/container/path \
Y
yejianwu 已提交
48 49
               -v /usr/bin/docker:/usr/bin/docker \
               -v /var/run/docker.sock:/var/run/docker.sock \
50 51 52
               registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite
    # Execute an interactive bash shell on the container
    docker exec -it mace-dev /bin/bash