I'm having some difficulty with a Docker Container that I spun up. I adapted some code that imports metrics for an EMC Isilon into an InfluxDB database for use in Grafana. I managed to get the code to run in the container but immediately after initial execution, the container exits with code 0. I'm learning Docker on the fly so it's a very real possibility that I'm missing something obvious (Please be gentle, absolutely taking advice but don't tear me apart if something is terribly obvious). I know links are taboo but I'm going to link to the original article and the git repo used (let me know if there is a better way to handle that).
Git Repo: https://github.com/Isilon/isilon_data_insights_connector
I've tried setting stdin_open and tty on the docker-compose service I have configured. Unfortunately, that's the only thing I found online that might have kept the container running after execution.
[docker-compose]
isilonscan:
stdin_open: true
tty: true
build:
args:
- http_proxy=http://*****:3128
context: ./Isilonscan/isilonscan-context
dockerfile: Dockerfile
volumes:
- ./Isilonscan/isilonscan-data:/opt/isilon_data_insights_connector
- ./Isilonscan/isi_data_insights_d.cfg:/opt/isilon_data_insights_connector/isi_data_insights_d.cfg
depends_on:
- influxdb
command: ["python", "/opt/isilon_data_insights_connector/isi_data_insights_d.py", "start", "--config=/opt/isilon_data_insights_connector/isi_data_insights_d.cfg"]
[Dockerfile]
FROM python:2
WORKDIR /usr/src/app
COPY isilon-exporter /opt/isilon_data_insights_connector
RUN apt-get install git && \
cd /opt && \
git clone https://github.com/Isilon/isilon_data_insights_connector.git && \
cd ./isilon_data_insights_connector && \
#pip install --upgrade pip && \
#pip install --upgrade setuptools && \
pip install -r requirements.txt && \
apt-get remove git -y && \
apt-get clean all -y
ENTRYPOINT ["python", "/opt/isilon_data_insights_connector/isi_data_insights_d.py", "start", "--config=/opt/isilon_data_insights_connector/isi_data_insights_d.cfg"]
Expected: The code should run and end on a new line. Every 30 seconds (or configured interval), the container should poll the Isilon for metrics and stick them in an InfluxDB (different container).
Actual: While launching docker-compose up, it writes the output that it executed each step properly and then gets to the ends and exits with code 0. Checking docker ps shows that it is in fact no longer running.