User Tools

Site Tools


openag_brain:docker

Docker

The OpenAg system runs within 2 Docker containers: one for the openag_brain ROS system, and one for CouchDB. docker-compose coordinates between the 2 containers.

See docs.docker.com for detailed Docker documentation.

Handy Docker commands

See which containers are running:

docker ps

The Docker install script creates and runs 2 docker containers. You should see them listed when running docker ps:

openagbraindockerrpi_brain_1
openagbraindockerrpi_db_1

Stoping and starting the containers is done in the usual way:

docker-compose start
docker-compose stop
docker-compose restart

You can get logs for the containers via docker's logging command:

docker logs -f openagbraindockerrpi_brain_1

Running commands in containers

You can run bash commands within a container with docker exec:

docker exec <container> <command>

For example:

docker exec openagbraindockerrpi_brain_1 rosrun openag_brain load_fixture default

"Shelling into" running containers

OpenAg Brain is powered by ROS. Sometimes, you might want to interact with ROS in the Docker container directly. To do so, first shell into the Docker container:

docker exec -it openagbraindockerrpi_brain_1 bash

Then, activate the catkin workspace within the Docker container:

source catkin_ws/devel/setup.bash

Now, you can interact with ROS. For more, see ros.

Note that Docker containers are stateless, so if your Docker container restarts, it will lose the changes you make. If you need the changes to stick, build a new Docker image (see below).

Building new Docker images

If you're contributing to openag_brain, you might want to build new Docker images. To build new Docker images from openag_brain, you'll want to install the Docker command line tools. Running the install_docker.sh script from openag_brain_docker_rpi on your raspberry_pi will take care of installing these for you.

Once Docker is installed, building images is easy. Just:

cd ~/catkin_ws/src/openag_brain

and

docker build -t openag/rpi_brain .

You can provide your own tag/name in place of openag/rpi_brain. See Docker's docs on the build command for more.

Note: we've had trouble with Raspbian's Pixel desktop freezing while building Docker images. We've also had problems with Docker builds failing on Rasberry Pi 2 when no swapfile is configured. We recommend the following build setup for best results:

  • Use a Raspberry Pi 3
  • Make sure to configure a swapfile
  • Use Raspbian Jesse Lite (not the Desktop version)
  • ssh into your Pi and start the build over ssh
openag_brain/docker.txt · Last modified: 2017/01/10 21:51 by 133.130.48.124