FrontPage 

Fuego 1.0 wiki

Login or create account

Docker Tips in 'raw' format

{{TableOfContents}}
Here are some tips for using dropbox with fuego:

= Starting =
After the container is created, you should start it by running:

./fuego-host-scripts/docker-start-containter.sh

This will execute the container indicated by the last_fuego_container.id
(which is usually what you want)

== special privileged container ==
To run the container in a special privileged mode that allows access to host
USB devices (needed for accessing Android targets and USB-SERIAL devices), create it instead with:
{{{
./fuego-host-scripts/docker-create-usb-privileged-container.sh
}}}

To add a new device to be accessible inside the docker container, please edit the following line in docker-create-usb-privileged-container.sh:
{{{
CONTAINER_ID=`sudo docker create -it --privileged -v /dev/bus/usb:/dev/bus/usb -v /dev/ttyACM0:/dev/ttyACM0 -v $DIR/../userdata:/userdata --net="host" fuego`
}}}

With above, only "ttyUSBx" and "ttyACM0" will be detected and accessible inside the docker container.  

''NOTE: as of February, 2017, this script was in the next branch of the fuego repository.''


= Operations while running =
 * show the running docker ID
    * sudo docker ps
 * execute a command in the container
    * docker exec <id> <some_command>
 * attach another shell inside the container
    * sudo docker exec -i -t <id> bash
 * access docker container using ssh
    * ssh user@<ip_addr> -p 2222
    * sshd is running on 2222 in the container, if the default sshd_config is used
 * copy files to the container
    * docker cp foo <id>:/path/to/dest
 * copy files from the container
    * docker cp <id>:/path/to/src/foo bar

= Exiting =
To exit the docker container, just exit the primary shell that started
with the container was started.

= Persistence =
The Fuego container uses a docker volume mount so that some files persist
in the host filesystem, even when the container is not running.

In the host system, these are under ''userdata'' in the directory where
the container was started.  (This is usually in the top level of the fuego
repository.)

Here are some files that persist:
 * userdata/conf/config.xml - for jenkins front-end control
 * userdata/conf/boards* - for board definition files
 * userdata/conf/ttc.conf - for use with ttc targets
 * userdata/conf/tools.sh - this file has the multiplexor for the different toolchains (on the PLATFORM variable)
 * userdata/logs - this has logs from executed test runs
 * userdata/toolchains - this is where toolchains and SDKs should be installed
 * userdata/work
 * userdata/buildzone

= How to determine if you're inside the container =
 * grep -q docker /proc/1/cgroup ; echo $?
   * will be 0 if inside the container, 1 if on host

= cleaning up old images =
I build lots of docker images, and they leave lots of data around.
 * '''docker ps -a'''  - show docker containers on your system, and their images
 * '''docker images''' - show images on your system, and their age and size
 * '''docker rmi <id>''' - remove an image (you must remove any containers using this image first)
 * '''docker rm <id>''' - remove a container




TBWiki engine 1.8.3 by Tim Bird