Skip to content

Commit b5fb3ab

Browse files
brunocascioappleboy
authored andcommitted
Improved Docker Instructions (#11)
Moved multiple `RUN` instructions into one. This will reduce the number of layers. Also, I added `rm -rf /var/lib/apt/lists/*` to remove unnecessary data.
1 parent ad5a8e4 commit b5fb3ab

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

Dockerfile-71

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,28 @@ MAINTAINER Mahmoud Zalt <[email protected]>
1818

1919
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
2020
# "libpng12-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
21-
RUN apt-get update && \
22-
apt-get install -y --no-install-recommends \
23-
curl \
24-
libmemcached-dev \
25-
libz-dev \
26-
libpq-dev \
27-
libjpeg-dev \
28-
libpng12-dev \
29-
libfreetype6-dev \
30-
libssl-dev \
31-
libmcrypt-dev
21+
RUN apt-get update \
22+
&& apt-get install -y --no-install-recommends \
23+
curl \
24+
libmemcached-dev \
25+
libz-dev \
26+
libpq-dev \
27+
libjpeg-dev \
28+
libpng12-dev \
29+
libfreetype6-dev \
30+
libssl-dev \
31+
libmcrypt-dev \
32+
&& rm -rf /var/lib/apt/lists/*
3233

3334
# Install the PHP mcrypt extention
34-
RUN docker-php-ext-install mcrypt
35-
36-
# Install the PHP pdo_mysql extention
37-
RUN docker-php-ext-install pdo_mysql
38-
39-
# Install the PHP pdo_pgsql extention
40-
RUN docker-php-ext-install pdo_pgsql
41-
42-
#####################################
43-
# gd:
44-
#####################################
45-
46-
# Install the PHP gd library
47-
RUN docker-php-ext-configure gd \
48-
--enable-gd-native-ttf \
49-
--with-jpeg-dir=/usr/lib \
50-
--with-freetype-dir=/usr/include/freetype2 && \
35+
RUN docker-php-ext-install mcrypt \
36+
# Install the PHP pdo_mysql extention
37+
&& docker-php-ext-install pdo_mysql \
38+
# Install the PHP pdo_pgsql extention
39+
&& docker-php-ext-install pdo_pgsql \
40+
# Install the PHP gd library
41+
&& docker-php-ext-configure gd \
42+
--enable-gd-native-ttf \
43+
--with-jpeg-dir=/usr/lib \
44+
--with-freetype-dir=/usr/include/freetype2 && \
5145
docker-php-ext-install gd

0 commit comments

Comments
 (0)