Skip to content

Commit 8beb95a

Browse files
committed
Remove build deps after building yaml PHP ext
1 parent 26f2a1c commit 8beb95a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ RUN /usr/bin/composer -v
1717
#
1818
FROM php:$PHP_VERSION-cli-alpine AS php
1919
RUN apk add \
20-
autoconf \
2120
bzip2-dev \
2221
libsodium-dev \
2322
libxml2-dev \
2423
libxslt-dev \
25-
linux-headers \
26-
yaml-dev
24+
linux-headers
2725

2826
# fixes "sockets" compilation issues
2927
# sendrecvmsg.c:128:19: error: invalid application of 'sizeof' to incomplete type 'struct cmsgcred'
@@ -47,9 +45,10 @@ RUN docker-php-ext-install \
4745

4846
# install yaml extensions from PECL
4947
# https://pecl.php.net/package/yaml/2.2.3
50-
RUN apk add gcc make g++ zlib-dev \
48+
RUN apk add --virtual build-deps autoconf gcc make g++ zlib-dev yaml-dev \
5149
&& pecl channel-update pecl.php.net \
52-
&& pecl install yaml-2.2.3 && docker-php-ext-enable yaml
50+
&& pecl install yaml-2.2.3 && docker-php-ext-enable yaml \
51+
&& apk del build-deps
5352

5453
RUN which php; php -v; php -m; php -i | grep ini
5554

0 commit comments

Comments
 (0)