Skip to content

Commit 2f24067

Browse files
committed
Remove bundled python dependencies in favour of pip installed ones
1 parent 1a2a515 commit 2f24067

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

core/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ FROM php-base AS python-build
102102
ARG PYPI_MIXBOX_VERSION
103103
ARG PYPI_CYBOX_VERSION
104104
ARG PYPI_PYMISP_VERSION
105+
ARG PYPI_MISP_STIX_VERSION
105106

106107
RUN apt-get install -y --no-install-recommends \
107108
git \
@@ -129,7 +130,7 @@ EOF
129130
# 2. If missing, add it (with optional version from env (defaults to empty string))
130131
# 3. If present, replace with our specified version if it exists, otherwise leave
131132
# the upstream version alone.
132-
set -- "redis" "lief" "pydeep2" "python-magic" "misp-lib-stix2" "maec" "mixbox" "cybox" "pymisp"
133+
set -- "redis" "lief" "pydeep2" "python-magic" "misp-lib-stix2" "maec" "mixbox" "cybox" "pymisp" "misp-stix"
133134
for mod in "$@"; do
134135
mod_version_var=$(echo "PYPI_${mod}_VERSION" | tr '[:lower:]' '[:upper:]' | tr '-' '_')
135136
mod_version=$(eval "echo \"\$$mod_version_var\"")
@@ -151,11 +152,18 @@ EOF
151152
pip wheel --no-cache-dir -w /wheels/ -r /var/www/MISP/requirements.txt
152153

153154
# Remove files we do not care for
154-
rm -r /var/www/MISP/PyMISP
155155
find /var/www/MISP/INSTALL/* ! -name 'MYSQL.sql' -type f -exec rm {} +
156156
find /var/www/MISP/INSTALL/* ! -name 'MYSQL.sql' -type l -exec rm {} +
157157
# Remove most files in .git - we do not use git functionality in docker
158158
find /var/www/MISP/.git/* ! -name HEAD -exec rm -rf {} +
159+
# Remove libraries' submodules
160+
rm -r /var/www/MISP/PyMISP
161+
rm -r /var/www/MISP/app/files/scripts/cti-python-stix2
162+
rm -r /var/www/MISP/app/files/scripts/misp-stix
163+
rm -r /var/www/MISP/app/files/scripts/mixbox
164+
rm -r /var/www/MISP/app/files/scripts/python-cybox
165+
rm -r /var/www/MISP/app/files/scripts/python-maec
166+
rm -r /var/www/MISP/app/files/scripts/python-stix
159167
EOF
160168

161169

docker-bake.hcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ variable "PYPI_PYMISP_VERSION" {
3838
default = ""
3939
}
4040

41+
variable "PYPI_MISP_STIX" {
42+
default = ""
43+
}
44+
4145
variable "NAMESPACE" {
4246
default = null
4347
}

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ services:
5757
- PYPI_MIXBOX_VERSION=${PYPI_MIXBOX_VERSION}
5858
- PYPI_CYBOX_VERSION=${PYPI_CYBOX_VERSION}
5959
- PYPI_PYMISP_VERSION=${PYPI_PYMISP_VERSION}
60+
- PYPI_MISP_STIX_VERSION=${PYPI_MISP_STIX_VERSION}
6061
depends_on:
6162
redis:
6263
condition: service_healthy

template.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ LIBFAUP_COMMIT=3a26d0a
1717
# PYPI_MIXBOX_VERSION="==1.0.*"
1818
# PYPI_CYBOX_VERSION="==2.1.*"
1919
# PYPI_PYMISP_VERSION="==2.4.178"
20+
# PYPI_MISP_STIX_VERSION"==2.4.194"
2021

2122
# CORE_COMMIT takes precedence over CORE_TAG
2223
# CORE_COMMIT=c56d537

0 commit comments

Comments
 (0)