Skip to content

Commit 1482cb2

Browse files
committed
Remove slim flavour and docker hub deps
1 parent 27ec05e commit 1482cb2

9 files changed

Lines changed: 95 additions & 261 deletions

File tree

‎.github/workflows/release-latest.yml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
target: [misp-core, misp-modules, misp-core-slim, misp-modules-slim, misp-guard, misp-nginx]
14+
target: [misp-core, misp-modules, misp-guard, misp-nginx]
1515

1616
permissions:
1717
contents: write
@@ -38,13 +38,7 @@ jobs:
3838
echo "COMMIT_HASH=$COMMIT_HASH" >> "$GITHUB_ENV"
3939
OWNER=$(echo "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]')
4040
echo "NAMESPACE=ghcr.io/${OWNER}/misp-docker" >> "$GITHUB_ENV"
41-
TARGET="${{ matrix.target }}"
42-
TAG="${COMMIT_HASH}"
43-
if [[ "$TARGET" == *"-slim" ]]; then
44-
TARGET="${TARGET%-slim}"
45-
TAG="${TAG}-slim"
46-
fi
47-
echo "IMAGE=ghcr.io/${OWNER}/misp-docker/${TARGET}:${TAG}" >> "$GITHUB_ENV"
41+
echo "IMAGE=ghcr.io/${OWNER}/misp-docker/${{ matrix.target }}:${COMMIT_HASH}" >> "$GITHUB_ENV"
4842
4943
- name: Log in to the container registry
5044
uses: docker/login-action@v4
@@ -63,7 +57,6 @@ jobs:
6357
targets: ${{ matrix.target }}
6458

6559
- name: Generate SBOM
66-
if: ${{ !contains(matrix.target, '-slim') }}
6760
uses: anchore/sbom-action@v0
6861
with:
6962
image: ${{ env.IMAGE }}
@@ -76,7 +69,6 @@ jobs:
7669
upload-artifact: false
7770

7871
- name: Upload SBOM artifact
79-
if: ${{ !contains(matrix.target, '-slim') }}
8072
uses: actions/upload-artifact@v7
8173
with:
8274
name: sbom-${{ matrix.target }}

‎.github/workflows/test-build-latest.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
target: [misp-core, misp-modules, misp-core-slim, misp-modules-slim, misp-guard, misp-nginx]
13+
target: [misp-core, misp-modules, misp-guard, misp-nginx]
1414

1515
steps:
1616
- name: Checkout repository

‎Makefile‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DEFAULT_GOAL := help
22

3-
.PHONY: help build build-core build-nginx build-modules build-guard build-slim bake up down logs shellcheck clean prune
3+
.PHONY: help build build-core build-nginx build-modules build-guard bake up down logs shellcheck clean prune
44

55
help:
66
@echo "Usage: make <target>"
@@ -11,7 +11,6 @@ help:
1111
@echo " build-nginx Build misp-nginx only"
1212
@echo " build-modules Build misp-modules only"
1313
@echo " build-guard Build misp-guard only"
14-
@echo " build-slim Build all slim variant images"
1514
@echo " bake Build all images via docker buildx bake"
1615
@echo ""
1716
@echo "Runtime targets:"
@@ -39,9 +38,6 @@ build-modules:
3938
build-guard:
4039
docker compose build misp-guard
4140

42-
build-slim:
43-
docker compose build --build-arg CORE_FLAVOR=slim --build-arg MODULES_FLAVOR=slim
44-
4541
bake:
4642
docker buildx bake
4743

‎README.md‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ CUSTOM_AUTH_CUSTOM_LOGOUT=
367367
- `./files`: `/var/www/MISP/app/files/`
368368
- `./gnupg`: `/var/www/MISP/.gnupg/`
369369
- If you need to automatically run additional steps each time the container starts, create a new file `files/customize_misp.sh`, and replace the variable `${CUSTOM_PATH}` inside `docker-compose.yml` with its parent path.
370-
- If you are interested in running streamlined versions of the images (fewer dependencies, easier approval from compliance), you might want to use the `latest-slim` tag. Just adjust the `docker-compose.yml` file, and run again `docker compose pull` and `docker compose up`.
371370
372371
#### Breaking changes
373372
@@ -399,6 +398,8 @@ This improves security and scalability of the front-facing NGINX server but lead
399398
400399
**Kubernetes/Helm:** manifests have been updated for the new two-container topology; if you deploy via Helm/Kubernetes, review the updated chart before upgrading.
401400
401+
**Slim image flavour:** since we have been actively bumping dependencies and resolving security concerns, we are sunsetting slim images and focus our efforts on a single (standard) flavour for both `misp-core` and `misp-modules`.
402+
402403
### High availability deployments
403404
404405
If you want to deploy multiple `misp-core` containers behind a load balancer it is recommended that you set the following to static values in `.env` or otherwise inside the container environment as they are used in session handling, and if unset will randomly generate:
@@ -450,24 +451,7 @@ sed -e '/^[[:space:]]*$/d' -e '/[#@]/d' -e 's/\"//g' -e 's/\(^[^=]*\)=\(.*\)/\1=
450451
docker buildx bake -f docker-bake.hcl -f env.hcl --provenance false debian
451452
```
452453
453-
This builds `misp-core`, `misp-modules`, and `misp-guard` with all features included.
454-
455-
**Build slim images:**
456-
457-
```bash
458-
export NAMESPACE=local
459-
export COMMIT_HASH=`git rev-parse --short HEAD`
460-
sed -e '/^[[:space:]]*$/d' -e '/[#@]/d' -e 's/\"//g' -e 's/\(^[^=]*\)=\(.*\)/\1="\2"/' template.env > env.hcl
461-
docker buildx bake -f docker-bake.hcl -f env.hcl --provenance false debian-slim
462-
```
463-
464-
This builds lightweight versions of `misp-core-slim`, `misp-modules-slim`, and `misp-guard` with reduced dependencies.
465-
466-
**Available bake targets:**
467-
468-
- `standard` - Full-featured images (misp-core, misp-modules, misp-guard)
469-
- `slim` - Lightweight images (misp-core-slim, misp-modules-slim, misp-guard)
470-
- `default` - Builds all variants (both standard and slim)
454+
This builds `misp-core`, `misp-modules`, `misp-nginx`, and `misp-guard`.
471455
472456
**Note:** The (GNU) `sed` command converts `template.env` to `env.hcl` format by removing empty lines, comments, and properly formatting variables for the bake file (on OSX you should install `gsed`).
473457

‎core/Dockerfile‎

Lines changed: 73 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ FROM "${DOCKER_HUB_PROXY}python:3.14-slim-trixie" AS php-base
55

66
ARG CORE_TAG
77
ARG CORE_COMMIT
8-
ARG CORE_FLAVOR
98
ARG PHP_API_VERSION
109
RUN : "${PHP_API_VERSION:?Build argument PHP_API_VERSION is required and cannot be empty.}"
1110
ARG PHP_PACKAGE_VERSION
@@ -20,77 +19,46 @@ ENV DEBIAN_FRONTEND=noninteractive
2019

2120
RUN <<-EOF
2221
apt-get update
23-
24-
if [ "${CORE_FLAVOR}" = "slim" ]; then
25-
apt-get install -y --no-install-recommends \
26-
lsb-release \
27-
ca-certificates \
28-
tini \
29-
gettext \
30-
procps \
31-
sudo \
32-
openssl \
33-
gpg \
34-
gpg-agent \
35-
mariadb-client \
36-
rsync \
37-
rsyslog \
38-
php${PHP_PACKAGE_VERSION} \
39-
php${PHP_PACKAGE_VERSION}-curl \
40-
php${PHP_PACKAGE_VERSION}-xml \
41-
php${PHP_PACKAGE_VERSION}-mbstring \
42-
php${PHP_PACKAGE_VERSION}-mysql \
43-
php${PHP_PACKAGE_VERSION}-redis \
44-
php${PHP_PACKAGE_VERSION}-gd \
45-
php${PHP_PACKAGE_VERSION}-fpm \
46-
php${PHP_PACKAGE_VERSION}-zip \
47-
unzip \
48-
zip \
49-
curl \
50-
uuid-runtime \
51-
jq
52-
else
53-
apt-get install -y --no-install-recommends \
54-
lsb-release \
55-
ca-certificates \
56-
tini \
57-
gettext \
58-
procps \
59-
sudo \
60-
openssl \
61-
gpg \
62-
gpg-agent \
63-
mariadb-client \
64-
rsync \
65-
rsyslog \
66-
php${PHP_PACKAGE_VERSION} \
67-
php${PHP_PACKAGE_VERSION}-apcu \
68-
php${PHP_PACKAGE_VERSION}-curl \
69-
php${PHP_PACKAGE_VERSION}-xml \
70-
php${PHP_PACKAGE_VERSION}-intl \
71-
php${PHP_PACKAGE_VERSION}-bcmath \
72-
php${PHP_PACKAGE_VERSION}-mbstring \
73-
php${PHP_PACKAGE_VERSION}-mysql \
74-
php${PHP_PACKAGE_VERSION}-redis \
75-
php${PHP_PACKAGE_VERSION}-gd \
76-
php${PHP_PACKAGE_VERSION}-fpm \
77-
php${PHP_PACKAGE_VERSION}-zip \
78-
php${PHP_PACKAGE_VERSION}-ldap \
79-
libmagic1 \
80-
libldap-common \
81-
librdkafka1 \
82-
libbrotli1 \
83-
libsimdjson25 \
84-
libzstd1 \
85-
ssdeep \
86-
stunnel4 \
87-
libfuzzy2 \
88-
unzip \
89-
zip \
90-
curl \
91-
uuid-runtime \
92-
jq
93-
fi
22+
apt-get install -y --no-install-recommends \
23+
lsb-release \
24+
ca-certificates \
25+
tini \
26+
gettext \
27+
procps \
28+
sudo \
29+
openssl \
30+
gpg \
31+
gpg-agent \
32+
mariadb-client \
33+
rsync \
34+
rsyslog \
35+
php${PHP_PACKAGE_VERSION} \
36+
php${PHP_PACKAGE_VERSION}-apcu \
37+
php${PHP_PACKAGE_VERSION}-curl \
38+
php${PHP_PACKAGE_VERSION}-xml \
39+
php${PHP_PACKAGE_VERSION}-intl \
40+
php${PHP_PACKAGE_VERSION}-bcmath \
41+
php${PHP_PACKAGE_VERSION}-mbstring \
42+
php${PHP_PACKAGE_VERSION}-mysql \
43+
php${PHP_PACKAGE_VERSION}-redis \
44+
php${PHP_PACKAGE_VERSION}-gd \
45+
php${PHP_PACKAGE_VERSION}-fpm \
46+
php${PHP_PACKAGE_VERSION}-zip \
47+
php${PHP_PACKAGE_VERSION}-ldap \
48+
libmagic1 \
49+
libldap-common \
50+
librdkafka1 \
51+
libbrotli1 \
52+
libsimdjson25 \
53+
libzstd1 \
54+
ssdeep \
55+
stunnel4 \
56+
libfuzzy2 \
57+
unzip \
58+
zip \
59+
curl \
60+
uuid-runtime \
61+
jq
9462
EOF
9563

9664
# --- composer-build
@@ -101,7 +69,6 @@ WORKDIR /tmp
10169
ENV COMPOSER_ALLOW_SUPERUSER=1
10270
ARG CORE_TAG
10371
ARG CORE_COMMIT
104-
ARG CORE_FLAVOR
10572

10673
# prepare composer.json
10774
RUN curl -o /tmp/composer.json https://raw.githubusercontent.com/MISP/MISP/${CORE_COMMIT:-${CORE_TAG}}/app/composer.json && \
@@ -115,17 +82,12 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
11582
RUN <<-EOF
11683
composer config --no-interaction allow-plugins.composer/installers true
11784
composer install
118-
119-
if [ "${CORE_FLAVOR}" = "slim" ]; then
120-
:
121-
else
122-
composer require --with-all-dependencies --no-interaction \
123-
elasticsearch/elasticsearch:^8.7.0 \
124-
jakub-onderka/openid-connect-php:^1.0.0 \
125-
certmichelin/openid-connect-php:1.3.0 \
126-
phpseclib/phpseclib:^3.0.47 \
127-
aws/aws-sdk-php
128-
fi
85+
composer require --with-all-dependencies --no-interaction \
86+
elasticsearch/elasticsearch:^8.7.0 \
87+
jakub-onderka/openid-connect-php:^1.0.0 \
88+
certmichelin/openid-connect-php:1.3.0 \
89+
phpseclib/phpseclib:^3.0.47 \
90+
aws/aws-sdk-php
12991
EOF
13092

13193
# --- php-build
@@ -135,33 +97,22 @@ FROM php-base AS php-build
13597
ENV TZ=Etc/UTC
13698
ARG CORE_TAG
13799
ARG CORE_COMMIT
138-
ARG CORE_FLAVOR
139100
ARG PHP_API_VERSION
140101
ARG PHP_PACKAGE_VERSION
141102

142103
RUN <<-EOF
143-
if [ "${CORE_FLAVOR}" = "slim" ]; then
144-
apt-get install -y --no-install-recommends \
145-
gcc \
146-
g++ \
147-
git \
148-
make \
149-
php${PHP_PACKAGE_VERSION}-dev \
150-
php-pear
151-
else
152-
apt-get install -y --no-install-recommends \
153-
gcc \
154-
g++ \
155-
git \
156-
make \
157-
php${PHP_PACKAGE_VERSION}-dev \
158-
php-pear \
159-
libbrotli-dev \
160-
libfuzzy-dev \
161-
librdkafka-dev \
162-
libsimdjson-dev \
163-
libzstd-dev
164-
fi
104+
apt-get install -y --no-install-recommends \
105+
gcc \
106+
g++ \
107+
git \
108+
make \
109+
php${PHP_PACKAGE_VERSION}-dev \
110+
php-pear \
111+
libbrotli-dev \
112+
libfuzzy-dev \
113+
librdkafka-dev \
114+
libsimdjson-dev \
115+
libzstd-dev
165116
apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
166117
EOF
167118

@@ -171,31 +122,26 @@ RUN update-alternatives --set php /usr/bin/php${PHP_PACKAGE_VERSION} && \
171122
update-alternatives --set phpize /usr/bin/phpize${PHP_PACKAGE_VERSION}
172123

173124
RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie <<-EOF
174-
if [ "${CORE_FLAVOR}" = "slim" ]; then
175-
tar -czf /pecl_libs.tar.gz -T /dev/null
176-
else
177-
cp "/usr/lib/$(gcc -dumpmachine)"/libfuzzy.* /usr/lib
178-
pie install --no-cache \
179-
rdkafka/rdkafka \
180-
kjdev/zstd \
181-
kjdev/brotli \
182-
awesome/simdjson_plus
183-
git clone --recursive --depth=1 https://github.com/JakubOnderka/pecl-text-ssdeep.git /tmp/pecl-text-ssdeep
184-
cd /tmp/pecl-text-ssdeep && phpize && ./configure && make && make install
185-
tar -czf /pecl_libs.tar.gz \
186-
/usr/lib/php/${PHP_API_VERSION}/ssdeep.so \
187-
/usr/lib/php/${PHP_API_VERSION}/rdkafka.so \
188-
/usr/lib/php/${PHP_API_VERSION}/brotli.so \
189-
/usr/lib/php/${PHP_API_VERSION}/simdjson_plus.so \
190-
/usr/lib/php/${PHP_API_VERSION}/zstd.so
191-
fi
125+
cp "/usr/lib/$(gcc -dumpmachine)"/libfuzzy.* /usr/lib
126+
pie install --no-cache \
127+
rdkafka/rdkafka \
128+
kjdev/zstd \
129+
kjdev/brotli \
130+
awesome/simdjson_plus
131+
git clone --recursive --depth=1 https://github.com/JakubOnderka/pecl-text-ssdeep.git /tmp/pecl-text-ssdeep
132+
cd /tmp/pecl-text-ssdeep && phpize && ./configure && make && make install
133+
tar -czf /pecl_libs.tar.gz \
134+
/usr/lib/php/${PHP_API_VERSION}/ssdeep.so \
135+
/usr/lib/php/${PHP_API_VERSION}/rdkafka.so \
136+
/usr/lib/php/${PHP_API_VERSION}/brotli.so \
137+
/usr/lib/php/${PHP_API_VERSION}/simdjson_plus.so \
138+
/usr/lib/php/${PHP_API_VERSION}/zstd.so
192139
EOF
193140

194141
# --- python-build
195142
FROM php-base AS python-build
196143
ARG CORE_TAG
197144
ARG CORE_COMMIT
198-
ARG CORE_FLAVOR
199145

200146
RUN apt-get install -y --no-install-recommends \
201147
gcc \
@@ -281,7 +227,6 @@ EOF
281227
FROM php-base
282228
ARG CORE_TAG
283229
ARG CORE_COMMIT
284-
ARG CORE_FLAVOR
285230
ARG PHP_PACKAGE_VERSION
286231

287232
ENV PATH="/var/www/MISP/app/Console:${PATH}"
@@ -319,11 +264,7 @@ COPY --from=composer-build --chown=www-data:www-data --chmod=0550 /tmp/Vendor /v
319264

320265
# Gather these in one layer, only act on actual directories under /etc/php/
321266
RUN <<-EOF
322-
if [ "${CORE_FLAVOR}" = "slim" ]; then
323-
set --
324-
else
325-
set -- "ssdeep" "rdkafka" "brotli" "simdjson_plus" "zstd"
326-
fi
267+
set -- "ssdeep" "rdkafka" "brotli" "simdjson_plus" "zstd"
327268
for mod in "$@"; do
328269
for dir in /etc/php/*/; do
329270
echo "extension=${mod}.so" > "${dir}mods-available/${mod}.ini"

0 commit comments

Comments
 (0)