docker-splunk icon indicating copy to clipboard operation
docker-splunk copied to clipboard

Run ansible configuration during docker build process

Open marcusschiesser opened this issue 3 years ago • 1 comments

Currently, ansible configuration is run in the Docker run phase. This has a couple of disadvantages:

  1. Startup time, see https://github.com/splunk/docker-splunk/issues/10
  2. Existing etc files need to be converted to YAML files, see Create Custom Configs
  3. 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"]

marcusschiesser avatar Jan 11 '22 09:01 marcusschiesser

is there anything stopping me from doing this?🤔

kyrre avatar Jul 01 '24 16:07 kyrre