@@ -135,16 +135,23 @@ 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
140
139
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"
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
+
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
157
RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \
@@ -153,7 +160,7 @@ RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \
153
160
# pyinstaller start
154
161
# commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built
155
162
# use the following variables to choose the version of hubble
156
- ENV HUBBLE_CHECKOUT=v3.0.8
163
+ ARG HUBBLE_CHECKOUT=v3.0.8
157
164
ENV HUBBLE_VERSION=3.0.8
158
165
ENV HUBBLE_ITERATION=1
159
166
ENV HUBBLE_URL=https://github.com/hubblestack/hubble
@@ -167,7 +174,7 @@ ENV _INCLUDE_PATH=""
167
174
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
168
175
RUN git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
169
176
&& cd "$HUBBLE_SRC_PATH" \
170
- && git checkout "$HUBBLE_CHECKOUT" \
177
+ && git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
171
178
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
172
179
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
173
180
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
@@ -176,7 +183,8 @@ VOLUME /data
176
183
WORKDIR /hubble_build
177
184
ENTRYPOINT [ "/bin/bash" , "-o" , "xtrace" , "-c" ]
178
185
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' \
180
188
&& mkdir -p /var/log/hubble_osquery/backuplogs \
181
189
# hubble default configuration file
182
190
&& cp -rf /hubble_build/conf/hubble /etc/hubble/ \
0 commit comments