-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (29 loc) · 799 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM php:8.1-bookworm
LABEL maintainer="Andrea Falco <andrea@falco.sh>"
# PHP ext-snmp
RUN set -eux; \
persistentDeps=" \
libsnmp40 \
snmp-mibs-downloader \
"; \
buildDeps=" \
libsnmp-dev \
"; \
sed -i \
-e 's|\ main$|\ main\ contrib\ non-free|g' \
/etc/apt/sources.list.d/debian.sources \
; \
DEBIAN_FRONTEND=noninteractive apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
${persistentDeps} \
${buildDeps} \
; \
\
docker-php-ext-install -j$(nproc) snmp; \
\
DEBIAN_FRONTEND=noninteractive apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
-o APT::AutoRemove::SuggestsImportant=false \
${buildDeps} \
; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*