splunk / docker-splunk

Splunk Docker GitHub Repository
459 stars 253 forks source link

Run ansible configuration during docker build process #533

Open marcusschiesser opened 2 years ago

marcusschiesser commented 2 years ago

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"]
kyrre commented 2 months ago

is there anything stopping me from doing this?🤔