Skip to content

Commit 7f5d335

Browse files
committed
Switching over to using a deployment directory to only copy in the files we want.
1 parent 6310c45 commit 7f5d335

File tree

4 files changed

+47
-15
lines changed

4 files changed

+47
-15
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ logs/
1111

1212
devel/*
1313

14+
cache/
15+
!cache/deploy/
16+

bin/build.sh

+29-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
set -e
55

66
CACHE="cache"
7+
DEPLOY="cache/deploy"
78

89
SPLUNK_PRODUCT="splunk"
910
SPLUNK_HOME="/opt/splunk"
@@ -23,7 +24,7 @@ cd ..
2324
#
2425
# Download and cache local copy of Splunk to speed up future builds.
2526
#
26-
mkdir -p ${CACHE}
27+
mkdir -p ${CACHE} ${DEPLOY}
2728

2829
#ls -ltrh $CACHE # Debugging
2930
if test ! -f "${CACHE_FILENAME}"
@@ -57,15 +58,39 @@ echo "# Building Docker containers..."
5758
echo "# "
5859

5960
docker build . -f docker/0-0-core -t splunk-lab-core-0
61+
62+
#
63+
# Link in whatever files we need in the deploy directory before building
64+
#
65+
ln -f ${CACHE}/splunk-8.1.0.1-24fd52428b5a-Linux-x86_64.tgz ${DEPLOY}
6066
docker build \
6167
--build-arg SPLUNK_HOME=${SPLUNK_HOME} \
62-
--build-arg CACHE_FILENAME=${CACHE_FILENAME} \
68+
--build-arg CACHE_FILENAME=${DEPLOY}/${SPLUNK_FILENAME} \
6369
. -f docker/0-1-splunk -t splunk-lab-core-1
64-
docker build . -f docker/0-2-apps -t splunk-lab-core
70+
rm -f ${DEPLOY}/*
71+
72+
ln -f ${CACHE}/syndication-input-rssatomrdf_124.tgz ${DEPLOY}
73+
ln -f ${CACHE}/wordcloud-custom-visualization_111.tgz ${DEPLOY}
74+
ln -f ${CACHE}/slack-notification-alert_203.tgz ${DEPLOY}
75+
ln -f ${CACHE}/splunk-dashboard-examples_800.tgz ${DEPLOY}
76+
ln -f ${CACHE}/eventgen_720.tgz ${DEPLOY}
77+
ln -f ${CACHE}/rest-api-modular-input_198.tgz ${DEPLOY}
78+
docker build \
79+
--build-arg DEPLOY=${DEPLOY} \
80+
. -f docker/0-2-apps -t splunk-lab-core
81+
rm -f ${DEPLOY}/*
6582

6683
docker build . -f docker/1-splunk-lab -t splunk-lab
6784

68-
docker build . -f docker/1-splunk-lab-ml -t splunk-lab-ml
85+
ln -f ${CACHE}/python-for-scientific-computing-for-linux-64-bit_202.tgz ${DEPLOY}
86+
ln -f ${CACHE}/splunk-machine-learning-toolkit_520.tgz ${DEPLOY}
87+
ln -f ${CACHE}/nlp-text-analytics_102.tgz ${DEPLOY}
88+
ln -f ${CACHE}/halo-custom-visualization_113.tgz ${DEPLOY}
89+
ln -f ${CACHE}/sankey-diagram-custom-visualization_130.tgz ${DEPLOY}
90+
docker build \
91+
--build-arg DEPLOY=${DEPLOY} \
92+
. -f docker/1-splunk-lab-ml -t splunk-lab-ml
93+
rm -f ${DEPLOY}/*
6994

7095
echo "# "
7196
echo "# Tagging Docker containers..."

docker/0-2-apps

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ FROM splunk-lab-core-1
33

44
WORKDIR /tmp
55

6-
COPY cache/syndication-input-rssatomrdf_124.tgz /tmp/splunk-packages/
7-
COPY cache/wordcloud-custom-visualization_111.tgz /tmp/splunk-packages/
8-
COPY cache/slack-notification-alert_203.tgz /tmp/splunk-packages/
9-
COPY cache/splunk-dashboard-examples_800.tgz /tmp/splunk-packages/
10-
COPY cache/eventgen_720.tgz /tmp/splunk-packages/
11-
COPY cache/rest-api-modular-input_198.tgz /tmp/splunk-packages/
6+
ARG DEPLOY
7+
8+
COPY ${DEPLOY}/syndication-input-rssatomrdf_124.tgz /tmp/splunk-packages/
9+
COPY ${DEPLOY}/wordcloud-custom-visualization_111.tgz /tmp/splunk-packages/
10+
COPY ${DEPLOY}/slack-notification-alert_203.tgz /tmp/splunk-packages/
11+
COPY ${DEPLOY}/splunk-dashboard-examples_800.tgz /tmp/splunk-packages/
12+
COPY ${DEPLOY}/eventgen_720.tgz /tmp/splunk-packages/
13+
COPY ${DEPLOY}/rest-api-modular-input_198.tgz /tmp/splunk-packages/
1214

1315

1416
#

docker/1-splunk-lab-ml

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#
55
FROM splunk-lab-core
66

7-
COPY cache/python-for-scientific-computing-for-linux-64-bit_202.tgz /tmp/splunk-packages/
8-
COPY cache/splunk-machine-learning-toolkit_520.tgz /tmp/splunk-packages/
9-
COPY cache/nlp-text-analytics_102.tgz /tmp/splunk-packages/
10-
COPY cache/halo-custom-visualization_113.tgz /tmp/splunk-packages/
11-
COPY cache/sankey-diagram-custom-visualization_130.tgz /tmp/splunk-packages/
7+
ARG DEPLOY
8+
9+
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz /tmp/splunk-packages/
10+
COPY ${DEPLOY}/splunk-machine-learning-toolkit_520.tgz /tmp/splunk-packages/
11+
COPY ${DEPLOY}/nlp-text-analytics_102.tgz /tmp/splunk-packages/
12+
COPY ${DEPLOY}/halo-custom-visualization_113.tgz /tmp/splunk-packages/
13+
COPY ${DEPLOY}/sankey-diagram-custom-visualization_130.tgz /tmp/splunk-packages/
1214

1315

1416
#

0 commit comments

Comments
 (0)