Public Repository

Last pushed: 2 years ago
Short Description
MCAG_setupMotionDemo as a Docker image.
Full Description

Dockerfile:

FROM ubuntu:trusty

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    ca-certificates \
    git \
    libreadline-dev \
    wget \
    nano \
    && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/EuropeanSpallationSource/MCAG_setupMotionDemo.git \
    && cd MCAG_setupMotionDemo \
    && sed -i -- 's/read yesno/yesno=Y/g' install-epics.sh \
    && ./setup.sh \
    && mv ./.epics.$(hostname) ./.epics.motorsim \
    && echo "export EPICS_CA_ADDR_LIST=172.17.255.255" >> ./.epics.motorsim \
    && echo "export EPICS_CA_AUTO_ADDR_LIST=NO" >> ./.epics.motorsim \
    && echo ". /MCAG_setupMotionDemo/.epics.motorsim" >> /root/.bashrc \
    && echo "cp /MCAG_setupMotionDemo/.epics.motorsim /MCAG_setupMotionDemo/.epics.\$HOSTNAME" >> /root/.bashrc

COPY ./startup.sh /

CMD ["/startup.sh"]

Startup script:

#!/bin/bash -il

# Launch motorsim components
caRepeater &

cd /MCAG_setupMotionDemo/m-epics-IcePAP/simulator
./doit.sh &

cd /MCAG_setupMotionDemo/m-epics-IcePAP/epicsIOC
./doit.sh

# Cleanup (We stay in epicsIOC/doit.sh while running)
PID_CAREP=`ps aux | grep caRepeater | grep -v grep | awk '{ print $2 }'`
PID_MOTOR=`ps aux | grep simMotor | grep -v grep | awk '{ print $2 }'`

echo "Killing simMotor PID=$PID_MOTOR"
kill $PID_MOTOR

echo "Killing caRepeater PID=$PID_CAREP"
kill $PID_CAREP
Docker Pull Command
Owner
mikehart