@@ -135,26 +135,34 @@ RUN mkdir -p "$LIBGIT2TEMP" \
135
135
&& make \
136
136
&& make install
137
137
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
+
140
151
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
148
155
149
156
# fpm package making requirements start
150
- RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \
151
- && scl enable rh-ruby23 "gem install --no-ri --no-rdoc fpm"
157
+ RUN yum install -y centos-release-scl scl-utils
158
+ RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel
159
+ RUN scl enable rh-ruby23 "gem install --no-ri --no-rdoc fpm"
152
160
153
161
# pyinstaller start
154
162
# commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
155
163
# use the following variables to choose the version of hubble
156
- ENV HUBBLE_CHECKOUT=v3 .0.8
157
- ENV HUBBLE_VERSION=3 .0.8
164
+ ARG HUBBLE_CHECKOUT=v4 .0.0
165
+ ENV HUBBLE_VERSION=4 .0.0
158
166
ENV HUBBLE_ITERATION=1
159
167
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
160
168
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 +175,7 @@ ENV _INCLUDE_PATH=""
167
175
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
168
176
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
169
177
&& cd "$HUBBLE_SRC_PATH" \
170
- && git checkout "$HUBBLE_CHECKOUT" \
178
+ && git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
171
179
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
172
180
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
173
181
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -176,7 +184,8 @@ VOLUME /data
176
184
WORKDIR /hubble_build
177
185
ENTRYPOINT [ "/bin/bash" , "-o" , "xtrace" , "-c" ]
178
186
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' \
187
+ && eval \" $(pyenv init -)\" \
188
+ && pyinstaller --onedir --noconfirm --log-level ${_BINARY_LOG_LEVEL} --additional-hooks-dir=${_HOOK_DIR} --runtime-hook=pkg/pyinstaller-runtimehooks/pathopthubble.py hubble.py \
180
189
&& mkdir -p /var/log/hubble_osquery/backuplogs \
181
190
# hubble default configuration file
182
191
&& cp -rf /hubble_build/conf/hubble /etc/hubble/ \
0 commit comments