-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (34 loc) · 1.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.7-slim
# Install base dependencies
RUN apt-get update && apt-get install -y wget libjpeg-dev libxml2-dev libxslt-dev lib32z1-dev python-lxml
RUN pip install virtualenv
# Set up non-root user and assign manpage access
# since the splunkpackagingtoolkit requires access to the global manpage (man1) dir
RUN useradd -ms /bin/bash splunkbuild
RUN mkdir /usr/share/man/man1
RUN chown -R splunkbuild:splunkbuild /usr/share/man/man1
USER splunkbuild
# Change working directory to local user
WORKDIR /home/splunkbuild
RUN chown -R splunkbuild:splunkbuild /home/splunkbuild
RUN mkdir /home/splunkbuild/src
# Set up virtualenvironment for appinspect
ENV VIRTUAL_ENV_APPINSPECT=/home/splunkbuild/.venv/appinspect
RUN virtualenv -p python3 $VIRTUAL_ENV_APPINSPECT
ENV PATH="$VIRTUAL_ENV_APPINSPECT/bin:$PATH"
# Install and download appinspect + dependencies
RUN pip install Pillow
RUN wget https://download.splunk.com/misc/appinspect/splunk-appinspect-latest.tar.gz
RUN pip install splunk-appinspect-latest.tar.gz
RUN rm splunk-appinspect-latest.tar.gz
# Set up virtualenvironment for packagingtoolkit
ENV VIRTUAL_ENV_TOOLKIT=/home/splunkbuild/.venv/packagingtoolkit
RUN virtualenv -p python3 $VIRTUAL_ENV_TOOLKIT
ENV PATH="$VIRTUAL_ENV_TOOLKIT/bin:$PATH"
# Install and download appinspect + packagingtoolkit
RUN pip install semantic_version
RUN wget https://download.splunk.com/misc/packaging-toolkit/splunk-packaging-toolkit-1.0.1.tar.gz
RUN pip install splunk-packaging-toolkit-1.0.1.tar.gz
RUN rm splunk-packaging-toolkit-1.0.1.tar.gz
COPY --chown=splunkbuild:splunkbuild upload.py ./
WORKDIR /home/splunkbuild/src