Docker setupΒΆ

You can use Docker to run test IOCs that are convenient for testing without having to locally build and install EPICS IOCs. Please use the following Docker links to install and configure Docker:

To communicate with the Docker you have set up some environmental variables:


export DOCKER0_IP=""
export EPICS_CA_ADDR_LIST=$( echo $DOCKER0_IP | sed -e 's/^\([0-9]\+\)\.\([0-9]\+\)\..*$/\1.\2.255.255/' )
export EPICS_CA_MAX_ARRAY_BYTES=10000000

and to run docker with the correct images (assuming the preceding code block is saved in


SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTS_DIR/


docker pull ${MOTOR_DOCKERIMAGE}
docker pull ${PE_DOCKERIMAGE}
docker pull ${AD_DOCKERIMAGE}

mkdir -p /tmp/ophyd_AD_test/

# Create YYYY/MM/DD subdirectories.
# This is required because the images use a version of AD which
# does not create missing directories.
python $SCRIPTS_DIR/ /tmp/ophyd_AD_test/data1

docker run --rm -d -v /tmp/ophyd_AD_test:/tmp/ophyd_AD_test/ ${MOTOR_DOCKERIMAGE}
docker run --name=area-detector --rm -dit -v /tmp/ophyd_AD_test:/tmp/ophyd_AD_test/ -e AD_PREFIX="ADSIM:" ${AD_DOCKERIMAGE} /bin/bash
sleep 1  # Probably not needed?
docker exec area-detector iocSimDetector/ start
docker run --rm -d ${PE_DOCKERIMAGE}

Running this multiple times will lead to multiple instances of the images running.

For EPICS to know where to search for the IOCs you will need to do


to setup the EPICS environmental variables. To check that it is setup correctly

$ env | grep -i epics

To check if it is working, try

$ caget XF:31IDA-OP{Tbl-Ax:X1}Mtr


You may need to install pyepics, which installs epics-base and the corresponding caget executable:

conda install -c lightsource2-tag pyepics