File tree 4 files changed +41
-0
lines changed
4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ functions:
86
86
| Relay | `${bref-extra:relay-php-81}` |
87
87
| Scout APM | `${bref-extra:scoutapm-php-81}` |
88
88
| Scrypt | `${bref-extra:scrypt-php-81}` |
89
+ | SNMP | `${bref-extra:snmp-php-81}` |
89
90
| SPX | `${bref-extra:spx-php-81}` |
90
91
| SSH2 | `${bref-extra:ssh2-php-81}` |
91
92
| Swoole | `${bref-extra:swoole-php-81}` |
Original file line number Diff line number Diff line change
1
+ ARG PHP_VERSION
2
+ ARG BREF_VERSION
3
+ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
4
+
5
+ RUN LD_LIBRARY_PATH=/lib:/lib64 yum -y install amazon-linux-extras
6
+ RUN LD_LIBRARY_PATH=/lib:/lib64 amazon-linux-extras install epel -y
7
+ RUN LD_LIBRARY_PATH=/lib:/lib64 yum -y update
8
+ RUN LD_LIBRARY_PATH=/lib:/lib64 yum -y install net-snmp net-snmp-{devel,utils}
9
+
10
+ WORKDIR ${PHP_BUILD_DIR}/ext/snmp
11
+ RUN phpize
12
+ RUN ./configure --with-libdir=lib64 --disable-static --with-sn
13
+ RUN make -j `nproc` && make install
14
+
15
+ RUN cp `php-config --extension-dir`/snmp.so /tmp/snmp.so
16
+ RUN echo 'extension=snmp.so' > /tmp/ext.ini
17
+
18
+ RUN php /bref/lib-copy/copy-dependencies.php /tmp/snmp.so /tmp/extension-libs
19
+
20
+ # Build the final image with just the files we need
21
+ FROM scratch
22
+
23
+ # Copy things we installed to the final image
24
+ COPY --from=ext /tmp/snmp.so /opt/bref/extensions/snmp.so
25
+ COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-snmp.ini
26
+ COPY --from=ext /tmp/extension-libs /opt/lib
Original file line number Diff line number Diff line change
1
+ {
2
+ "php" : [
3
+ " 81" ,
4
+ " 82"
5
+ ]
6
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ if (!function_exists ($ func = 'snmp2_real_walk ' )) {
4
+ echo sprintf ('FAIL: Function "%s" does not exist. ' , $ func ).PHP_EOL ;
5
+ exit (1 );
6
+ }
7
+
8
+ exit (0 );
You can’t perform that action at this time.
0 commit comments