I'm new to docker and I'm struggling a bit with installing the required prerequisites.
I have this in my docker-composer.yml file, because I need the sflow plugin and I need the mysql jdbc driver:
command: >
bash -c "export http_proxy='http://proxy:3128' &&
export https_proxy=$http_proxy &&
export JRUBY_OPTS='-J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128' &&
DEBUG=1 JARS_SKIP='true' &&
bin/logstash-plugin install logstash-codec-sflow &&
yum install -y mysql-connector-java &&
bin/logstash"
user: root
This looks extremely unelegant to me as it is executed every time I run docker-compose up
.
Is there no way to install the required dependencies just once and persist them? If I drop into an interactive shell, install what's needed, then everything is gone when I run docker-compose down
.