Skip to content

Commit e69bbf9

Browse files
committed
Merge branch '4.0' of https://github.com/hubblestack/hubble into 4.0
* '4.0' of https://github.com/hubblestack/hubble: remove second disable= and combine The problem is a missing docstring in __init__.py assume this file being empty is the main problem 404 file not found... save and preserve the relevant-files.txt 3.0.8 → 4.0.0 move COPY pyinstaller-reqs down and fix a minor typo use pyenv and allow alt checkouts
2 parents b4538f9 + 1ced0fa commit e69bbf9

File tree

14 files changed

+181
-71
lines changed

14 files changed

+181
-71
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ __pycache__/
77
*.py[cod]
88
*$py.class
99

10+
# patch detritus
11+
*.rej
12+
*.orig
13+
1014
# C extensions
1115
*.so
1216

.pipeline

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ pipeline {
5151
else find hubblestack -name "*.py" -print0 | xargs -r0 git diff --name-only "$LHS" "$RHS"
5252
fi > relevant-files.txt
5353
'''
54-
sh '''mkdir -vp tests/unittests/output'''
54+
sh ''' mkdir -vp tests/unittests/output
55+
cp relevant-files.txt tests/unittests/output
56+
'''
5557
}
5658
}
5759
stage('lint/test') {
@@ -106,7 +108,7 @@ pipeline {
106108
alwaysLinkToLastBuild: false,
107109
keepAll: true,
108110
reportDir: 'tests/unittests/output',
109-
reportFiles: 'pytest.html, coverage/index.html, pylint.html, profile-diagram.svg, bandit.html',
111+
reportFiles: 'pytest.html, coverage/index.html, pylint.html, profile-diagram.svg, bandit.html, relevant-files.txt',
110112
reportName: "Test Reports"
111113
])
112114
}

doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = u'3.0.8'
62+
version = u'4.0.0'
6363
# The full version, including alpha/beta/rc tags.
64-
release = u'3.0.8-1'
64+
release = u'4.0.0-1'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

hubblestack/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '3.0.8'
1+
__version__ = '4.0.0'
22

33
__buildinfo__ = {'branch': 'BRANCH_NOT_SET', 'last_commit': 'COMMIT_NOT_SET'}

pkg/amazonlinux2016.09/Dockerfile

+19-8
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,22 @@ RUN mkdir -p "$LIBGIT2TEMP" \
136136
&& make \
137137
&& make install
138138

139-
#pyinstaller requirements start
140-
#must be preceded by libgit2 install
139+
# use pyenv
140+
ARG PYENV_VERSION=3.6.10
141+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
142+
ENV PYENV_ROOT=/usr/local/pyenv
143+
ENV PATH=$PYENV_ROOT/bin:$PATH
144+
RUN umask 022 \
145+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
146+
&& chmod 0755 /usr/bin/pyenv-installer \
147+
&& /usr/bin/pyenv-installer \
148+
&& eval "$(pyenv init -)" \
149+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
150+
&& pyenv global $PYENV_VERSION
151+
141152
COPY pyinstaller-requirements.txt /
142-
#default python-pip from yum does not like upgrading itself from pip. looking for better options other than wget.
143-
RUN wget -c https://bootstrap.pypa.io/get-pip.py \
144-
&& python get-pip.py \
153+
RUN eval "$(pyenv init -)" \
154+
&& pip -v install --upgrade pip \
145155
&& pip -v install -r pyinstaller-requirements.txt
146156

147157
#fpm package making requirements start
@@ -151,8 +161,8 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \
151161
#pyinstaller start
152162
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
153163
#use the following variables to choose the version of hubble
154-
ENV HUBBLE_CHECKOUT=v3.0.8
155-
ENV HUBBLE_VERSION=3.0.8
164+
ARG HUBBLE_CHECKOUT=v4.0.0
165+
ENV HUBBLE_VERSION=4.0.0
156166
ENV HUBBLE_ITERATION=1
157167
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
158168
ENV HUBBLE_DESCRIPTION="Hubble is a modular, open-source, security & compliance auditing framework which is built in python, using SaltStack as a library."
@@ -165,7 +175,7 @@ ENV _INCLUDE_PATH=""
165175
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
166176
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
167177
&& cd "$HUBBLE_SRC_PATH" \
168-
&& git checkout "$HUBBLE_CHECKOUT" \
178+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
169179
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
170180
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
171181
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -174,6 +184,7 @@ VOLUME /data
174184
WORKDIR /hubble_build
175185
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
176186
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
187+
&& eval \"$(pyenv init -)\" \
177188
&& pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
178189
&& mkdir -p /var/log/hubble_osquery/backuplogs \
179190
# hubble default configuration file

pkg/centos6/Dockerfile

+21-13
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,23 @@ RUN mkdir -p "$LIBGIT2TEMP" \
135135
&& make \
136136
&& make install
137137

138-
#pyinstaller requirements start
139-
#must be preceded by libgit2 install
138+
# use pyenv
139+
ARG PYENV_VERSION=3.6.10
140+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
141+
ENV PYENV_ROOT=/usr/local/pyenv
142+
ENV PATH=$PYENV_ROOT/bin:$PATH
143+
RUN umask 022 \
144+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
145+
&& chmod 0755 /usr/bin/pyenv-installer \
146+
&& /usr/bin/pyenv-installer \
147+
&& eval "$(pyenv init -)" \
148+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
149+
&& pyenv global $PYENV_VERSION
150+
140151
COPY pyinstaller-requirements.txt /
141-
#default python-pip from yum does not like upgrading itself from pip. looking for better options other than wget.
142-
RUN wget -c https://bootstrap.pypa.io/get-pip.py \
143-
&& yum -y install centos-release-scl \
144-
&& yum -y install python27 \
145-
&& chmod u+x ./get-pip.py \
146-
&& scl enable python27 "./get-pip.py" \
147-
&& scl enable python27 "pip -v install -r pyinstaller-requirements.txt"
152+
RUN eval "$(pyenv init -)" \
153+
&& pip -v install --upgrade pip \
154+
&& pip -v install -r pyinstaller-requirements.txt
148155

149156
#fpm package making requirements start
150157
RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \
@@ -153,8 +160,8 @@ RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \
153160
#pyinstaller start
154161
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
155162
#use the following variables to choose the version of hubble
156-
ENV HUBBLE_CHECKOUT=v3.0.8
157-
ENV HUBBLE_VERSION=3.0.8
163+
ARG HUBBLE_CHECKOUT=v4.0.0
164+
ENV HUBBLE_VERSION=4.0.0
158165
ENV HUBBLE_ITERATION=1
159166
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
160167
ENV HUBBLE_DESCRIPTION="Hubble is a modular, open-source, security & compliance auditing framework which is built in python, using SaltStack as a library."
@@ -167,7 +174,7 @@ ENV _INCLUDE_PATH=""
167174
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
168175
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
169176
&& cd "$HUBBLE_SRC_PATH" \
170-
&& git checkout "$HUBBLE_CHECKOUT" \
177+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
171178
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
172179
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
173180
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -176,7 +183,8 @@ VOLUME /data
176183
WORKDIR /hubble_build
177184
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
178185
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
179-
&& scl enable python27 'pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py' \
186+
&& eval \"$(pyenv init -)\" \
187+
&& python27 'pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py' \
180188
&& mkdir -p /var/log/hubble_osquery/backuplogs \
181189
# hubble default configuration file
182190
&& cp -rf /hubble_build/conf/hubble /etc/hubble/ \

pkg/centos7/Dockerfile

+19-8
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,22 @@ RUN mkdir -p "$LIBGIT2TEMP" \
134134
&& make \
135135
&& make install
136136

137-
#pyinstaller requirements start
138-
#must be preceded by libgit2 install
137+
# use pyenv
138+
ARG PYENV_VERSION=3.6.10
139+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
140+
ENV PYENV_ROOT=/usr/local/pyenv
141+
ENV PATH=$PYENV_ROOT/bin:$PATH
142+
RUN umask 022 \
143+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
144+
&& chmod 0755 /usr/bin/pyenv-installer \
145+
&& /usr/bin/pyenv-installer \
146+
&& eval "$(pyenv init -)" \
147+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
148+
&& pyenv global $PYENV_VERSION
149+
139150
COPY pyinstaller-requirements.txt /
140-
#default python-pip from yum does not like upgrading itself from pip. looking for better options other than wget.
141-
RUN wget -c https://bootstrap.pypa.io/get-pip.py \
142-
&& python get-pip.py \
151+
RUN eval "$(pyenv init -)" \
152+
&& pip -v install --upgrade pip \
143153
&& pip -v install -r pyinstaller-requirements.txt
144154

145155
#fpm package making requirements start
@@ -149,8 +159,8 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \
149159
#pyinstaller start
150160
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
151161
#use the following variables to choose the version of hubble
152-
ENV HUBBLE_CHECKOUT=v3.0.8
153-
ENV HUBBLE_VERSION=3.0.8
162+
ARG HUBBLE_CHECKOUT=v4.0.0
163+
ENV HUBBLE_VERSION=4.0.0
154164
ENV HUBBLE_ITERATION=1
155165
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
156166
ENV HUBBLE_DESCRIPTION="Hubble is a modular, open-source, security & compliance auditing framework which is built in python, using SaltStack as a library."
@@ -163,7 +173,7 @@ ENV _INCLUDE_PATH=""
163173
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
164174
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
165175
&& cd "$HUBBLE_SRC_PATH" \
166-
&& git checkout "$HUBBLE_CHECKOUT" \
176+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
167177
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
168178
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
169179
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -172,6 +182,7 @@ VOLUME /data
172182
WORKDIR /hubble_build
173183
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
174184
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
185+
&& eval \"$(pyenv init -)\" \
175186
&& pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
176187
&& mkdir -p /var/log/hubble_osquery/backuplogs \
177188
# hubble default configuration file

pkg/coreos/Dockerfile

+20-6
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,38 @@ RUN mkdir -p "$LIBGIT2TEMP" \
152152
&& make \
153153
&& make install
154154

155-
#pyinstaller requirements start
156-
#must be preceded by libgit2 install
155+
# use pyenv
156+
ARG PYENV_VERSION=3.6.10
157+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
158+
ENV PYENV_ROOT=/usr/local/pyenv
159+
ENV PATH=$PYENV_ROOT/bin:$PATH
160+
RUN umask 022 \
161+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
162+
&& chmod 0755 /usr/bin/pyenv-installer \
163+
&& /usr/bin/pyenv-installer \
164+
&& eval "$(pyenv init -)" \
165+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
166+
&& pyenv global $PYENV_VERSION
167+
157168
COPY pyinstaller-requirements.txt /
158-
RUN pip -v install -r pyinstaller-requirements.txt
169+
RUN eval "$(pyenv init -)" \
170+
&& pip -v install --upgrade pip \
171+
&& pip -v install -r pyinstaller-requirements.txt
159172

160173
#pyinstaller start
161174
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
162175
#use the following variables to choose the version of hubble
163-
ENV HUBBLE_CHECKOUT=v3.0.8
176+
ARG HUBBLE_CHECKOUT=v4.0.0
164177
ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git
165-
ENV HUBBLE_VERSION=3.0.8
178+
ENV HUBBLE_VERSION=4.0.0
166179
ENV HUBBLE_ITERATION=1
167180
ENV HUBBLE_SRC_PATH=/hubble_src
168181
ENV _HOOK_DIR="./pkg/"
169182
ENV _BINARY_LOG_LEVEL="INFO"
170183
ENV _INCLUDE_PATH=""
171184
RUN git clone ${HUBBLE_GIT_URL} "$HUBBLE_SRC_PATH" \
172185
&& cd "$HUBBLE_SRC_PATH" \
173-
&& git checkout ${HUBBLE_CHECKOUT} \
186+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
174187
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
175188
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
176189
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -179,6 +192,7 @@ VOLUME /data
179192
WORKDIR /hubble_build
180193
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
181194
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
195+
&& eval \"$(pyenv init -)\" \
182196
&& pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
183197
&& mkdir -p /var/log/hubble_osquery/backuplogs \
184198
# hubble default configuration file

pkg/debian10/Dockerfile

+20-6
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,23 @@ RUN mkdir -p "$LIBGIT2TEMP" \
152152
&& make \
153153
&& make install
154154

155-
#pyinstaller requirements start
156-
#must be preceded by libgit2 install
155+
# use pyenv
156+
ARG PYENV_VERSION=3.6.10
157+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
158+
ENV PYENV_ROOT=/usr/local/pyenv
159+
ENV PATH=$PYENV_ROOT/bin:$PATH
160+
RUN umask 022 \
161+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
162+
&& chmod 0755 /usr/bin/pyenv-installer \
163+
&& /usr/bin/pyenv-installer \
164+
&& eval "$(pyenv init -)" \
165+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
166+
&& pyenv global $PYENV_VERSION
167+
157168
COPY pyinstaller-requirements.txt /
158-
RUN pip -v install -r pyinstaller-requirements.txt
169+
RUN eval "$(pyenv init -)" \
170+
&& pip -v install --upgrade pip \
171+
&& pip -v install -r pyinstaller-requirements.txt
159172

160173
#deb package making requirements start
161174
RUN apt-get install -y ruby ruby-dev rubygems gcc make \
@@ -164,9 +177,9 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \
164177
#pyinstaller start
165178
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
166179
#use the following variables to choose the version of hubble
167-
ENV HUBBLE_CHECKOUT=v3.0.8
180+
ARG HUBBLE_CHECKOUT=v4.0.0
168181
ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git
169-
ENV HUBBLE_VERSION=3.0.8
182+
ENV HUBBLE_VERSION=4.0.0
170183
ENV HUBBLE_ITERATION=1
171184
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
172185
ENV HUBBLE_SRC_PATH=/hubble_src
@@ -176,7 +189,7 @@ ENV _INCLUDE_PATH=""
176189
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
177190
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
178191
&& cd "$HUBBLE_SRC_PATH" \
179-
&& git checkout "$HUBBLE_CHECKOUT" \
192+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
180193
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
181194
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
182195
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -185,6 +198,7 @@ VOLUME /data
185198
WORKDIR /hubble_build
186199
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
187200
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
201+
&& eval \"$(pyenv init -)\" \
188202
&& pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
189203
&& mkdir -p /var/log/hubble_osquery/backuplogs \
190204
# hubble default configuration file

pkg/debian7/Dockerfile

+19-7
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,22 @@ RUN mkdir -p "$LIBGIT2TEMP" \
173173
&& make \
174174
&& make install
175175

176-
#pyinstaller requirements start
177-
#must be preceded by libgit2 install
176+
# use pyenv
177+
ARG PYENV_VERSION=3.6.10
178+
ENV PYENV_INSTALLER_URL=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
179+
ENV PYENV_ROOT=/usr/local/pyenv
180+
ENV PATH=$PYENV_ROOT/bin:$PATH
181+
RUN umask 022 \
182+
&& curl -s -S -L "$PYENV_INSTALLER_URL" -o /usr/bin/pyenv-installer \
183+
&& chmod 0755 /usr/bin/pyenv-installer \
184+
&& /usr/bin/pyenv-installer \
185+
&& eval "$(pyenv init -)" \
186+
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYENV_VERSION \
187+
&& pyenv global $PYENV_VERSION
188+
178189
COPY pyinstaller-requirements.txt /
179-
RUN wget -c https://bootstrap.pypa.io/get-pip.py \
180-
&& python get-pip.py \
190+
RUN eval "$(pyenv init -)" \
191+
&& pip -v install --upgrade pip \
181192
&& pip -v install -r pyinstaller-requirements.txt
182193

183194
#deb package making requirements start
@@ -187,9 +198,9 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \
187198
#pyinstaller start
188199
#commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
189200
#use the following variables to choose the version of hubble
190-
ENV HUBBLE_CHECKOUT=v3.0.8
201+
ARG HUBBLE_CHECKOUT=v4.0.0
191202
ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git
192-
ENV HUBBLE_VERSION=3.0.8
203+
ENV HUBBLE_VERSION=4.0.0
193204
ENV HUBBLE_ITERATION=1
194205
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
195206
ENV HUBBLE_SRC_PATH=/hubble_src
@@ -199,7 +210,7 @@ ENV _INCLUDE_PATH=""
199210
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
200211
RUN git clone ${HUBBLE_GIT_URL} "$HUBBLE_SRC_PATH" \
201212
&& cd "$HUBBLE_SRC_PATH" \
202-
&& git checkout ${HUBBLE_CHECKOUT} \
213+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
203214
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
204215
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
205216
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -208,6 +219,7 @@ VOLUME /data
208219
WORKDIR /hubble_build
209220
ENTRYPOINT [ "/bin/bash", "-o", "xtrace", "-c" ]
210221
CMD [ "if [ -f /data/hubble_buildinfo ] ; then echo \"\" >> /hubble_build/hubblestack/__init__.py ; cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py; fi \
222+
&& eval \"$(pyenv init -)\" \
211223
&& pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
212224
&& mkdir -p /var/log/hubble_osquery/backuplogs \
213225
# hubble default configuration file

0 commit comments

Comments
 (0)