Uncommon for Docker - build phase is usually used for configuration
My expectation would be that I could do the ansible configuration first during build time and then just run the splunk process with Docker run, e.g. like this:
FROM splunk/splunk:8.2.4
ENV SPLUNK_START_ARGS --accept-license
ENV SPLUNK_PASSWORD splunkdev
# Configure using ansible
USER ansible
COPY ./tmp /tmp
RUN /sbin/entrypoint.sh start-and-exit
USER splunk
# Do whatever post-configuration, change etc files, copy apps etc.
ENTRYPOINT ["/opt/splunk/bin/splunk"]
CMD ["start"]
Currently, ansible configuration is run in the Docker run phase. This has a couple of disadvantages:
etc
files need to be converted to YAML files, see Create Custom ConfigsMy expectation would be that I could do the ansible configuration first during build time and then just run the
splunk
process with Docker run, e.g. like this: