Skip to content

Commit 82d590a

Browse files
J0WItianon
authored andcommitted
Use already available curl and consistent code style
1 parent c0f68b2 commit 82d590a

File tree

43 files changed

+1033
-966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1033
-966
lines changed

7.1/alpine3.10/cli/Dockerfile

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ RUN apk add --no-cache \
2929
openssl
3030

3131
# ensure www-data user exists
32-
RUN set -x \
33-
&& addgroup -g 82 -S www-data \
34-
&& adduser -u 82 -D -S -G www-data www-data
32+
RUN set -xe; \
33+
addgroup -g 82 -S www-data; \
34+
adduser -u 82 -D -S -G www-data www-data
3535
# 82 is the standard uid/gid for "www-data" in Alpine
3636
# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable
3737
# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable
@@ -69,13 +69,12 @@ RUN set -xe; \
6969
\
7070
apk add --no-cache --virtual .fetch-deps \
7171
gnupg \
72-
wget \
7372
; \
7473
\
7574
mkdir -p /usr/src; \
7675
cd /usr/src; \
7776
\
78-
wget -O php.tar.xz "$PHP_URL"; \
77+
curl -fsSL -o php.tar.xz "$PHP_URL"; \
7978
\
8079
if [ -n "$PHP_SHA256" ]; then \
8180
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
@@ -85,7 +84,7 @@ RUN set -xe; \
8584
fi; \
8685
\
8786
if [ -n "$PHP_ASC_URL" ]; then \
88-
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
87+
curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \
8988
export GNUPGHOME="$(mktemp -d)"; \
9089
for key in $GPG_KEYS; do \
9190
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
@@ -99,23 +98,25 @@ RUN set -xe; \
9998

10099
COPY docker-php-source /usr/local/bin/
101100

102-
RUN set -xe \
103-
&& apk add --no-cache --virtual .build-deps \
101+
RUN set -xe; \
102+
apk add --no-cache --virtual .build-deps \
104103
$PHPIZE_DEPS \
105104
coreutils \
106105
curl-dev \
107106
libedit-dev \
108107
libxml2-dev \
109108
openssl-dev \
110109
sqlite-dev \
110+
; \
111111
\
112-
&& export CFLAGS="$PHP_CFLAGS" \
112+
export CFLAGS="$PHP_CFLAGS" \
113113
CPPFLAGS="$PHP_CPPFLAGS" \
114114
LDFLAGS="$PHP_LDFLAGS" \
115-
&& docker-php-source extract \
116-
&& cd /usr/src/php \
117-
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
118-
&& ./configure \
115+
; \
116+
docker-php-source extract; \
117+
cd /usr/src/php; \
118+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
119+
./configure \
119120
--build="$gnuArch" \
120121
--with-config-file-path="$PHP_INI_DIR" \
121122
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
@@ -143,33 +144,34 @@ RUN set -xe \
143144
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
144145
\
145146
$PHP_EXTRA_CONFIGURE_ARGS \
146-
&& make -j "$(nproc)" \
147-
&& find -type f -name '*.a' -delete \
148-
&& make install \
149-
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
150-
&& make clean \
147+
; \
148+
make -j "$(nproc)"; \
149+
find -type f -name '*.a' -delete; \
150+
make install; \
151+
{ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \
152+
make clean; \
151153
\
152154
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
153-
&& cp -v php.ini-* "$PHP_INI_DIR/" \
155+
cp -v php.ini-* "$PHP_INI_DIR/"; \
154156
\
155-
&& cd / \
156-
&& docker-php-source delete \
157+
cd /; \
158+
docker-php-source delete; \
157159
\
158-
&& runDeps="$( \
160+
runDeps="$( \
159161
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
160162
| tr ',' '\n' \
161163
| sort -u \
162164
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
163-
)" \
164-
&& apk add --no-cache $runDeps \
165+
)"; \
166+
apk add --no-cache $runDeps; \
165167
\
166-
&& apk del --no-network .build-deps \
168+
apk del --no-network .build-deps; \
167169
\
168170
# update pecl channel definitions https://github.com/docker-library/php/issues/443
169-
&& pecl update-channels \
170-
&& rm -rf /tmp/pear ~/.pearrc \
171+
pecl update-channels; \
172+
rm -rf /tmp/pear ~/.pearrc; \
171173
# smoke test
172-
&& php --version
174+
php --version
173175

174176
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
175177

7.1/alpine3.10/fpm/Dockerfile

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ RUN apk add --no-cache \
2929
openssl
3030

3131
# ensure www-data user exists
32-
RUN set -x \
33-
&& addgroup -g 82 -S www-data \
34-
&& adduser -u 82 -D -S -G www-data www-data
32+
RUN set -xe; \
33+
addgroup -g 82 -S www-data; \
34+
adduser -u 82 -D -S -G www-data www-data
3535
# 82 is the standard uid/gid for "www-data" in Alpine
3636
# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable
3737
# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable
@@ -70,13 +70,12 @@ RUN set -xe; \
7070
\
7171
apk add --no-cache --virtual .fetch-deps \
7272
gnupg \
73-
wget \
7473
; \
7574
\
7675
mkdir -p /usr/src; \
7776
cd /usr/src; \
7877
\
79-
wget -O php.tar.xz "$PHP_URL"; \
78+
curl -fsSL -o php.tar.xz "$PHP_URL"; \
8079
\
8180
if [ -n "$PHP_SHA256" ]; then \
8281
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
@@ -86,7 +85,7 @@ RUN set -xe; \
8685
fi; \
8786
\
8887
if [ -n "$PHP_ASC_URL" ]; then \
89-
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
88+
curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \
9089
export GNUPGHOME="$(mktemp -d)"; \
9190
for key in $GPG_KEYS; do \
9291
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
@@ -100,23 +99,25 @@ RUN set -xe; \
10099

101100
COPY docker-php-source /usr/local/bin/
102101

103-
RUN set -xe \
104-
&& apk add --no-cache --virtual .build-deps \
102+
RUN set -xe; \
103+
apk add --no-cache --virtual .build-deps \
105104
$PHPIZE_DEPS \
106105
coreutils \
107106
curl-dev \
108107
libedit-dev \
109108
libxml2-dev \
110109
openssl-dev \
111110
sqlite-dev \
111+
; \
112112
\
113-
&& export CFLAGS="$PHP_CFLAGS" \
113+
export CFLAGS="$PHP_CFLAGS" \
114114
CPPFLAGS="$PHP_CPPFLAGS" \
115115
LDFLAGS="$PHP_LDFLAGS" \
116-
&& docker-php-source extract \
117-
&& cd /usr/src/php \
118-
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
119-
&& ./configure \
116+
; \
117+
docker-php-source extract; \
118+
cd /usr/src/php; \
119+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
120+
./configure \
120121
--build="$gnuArch" \
121122
--with-config-file-path="$PHP_INI_DIR" \
122123
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
@@ -144,43 +145,44 @@ RUN set -xe \
144145
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
145146
\
146147
$PHP_EXTRA_CONFIGURE_ARGS \
147-
&& make -j "$(nproc)" \
148-
&& find -type f -name '*.a' -delete \
149-
&& make install \
150-
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
151-
&& make clean \
148+
; \
149+
make -j "$(nproc)"; \
150+
find -type f -name '*.a' -delete; \
151+
make install; \
152+
{ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \
153+
make clean; \
152154
\
153155
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
154-
&& cp -v php.ini-* "$PHP_INI_DIR/" \
156+
cp -v php.ini-* "$PHP_INI_DIR/"; \
155157
\
156-
&& cd / \
157-
&& docker-php-source delete \
158+
cd /; \
159+
docker-php-source delete; \
158160
\
159-
&& runDeps="$( \
161+
runDeps="$( \
160162
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
161163
| tr ',' '\n' \
162164
| sort -u \
163165
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
164-
)" \
165-
&& apk add --no-cache $runDeps \
166+
)"; \
167+
apk add --no-cache $runDeps; \
166168
\
167-
&& apk del --no-network .build-deps \
169+
apk del --no-network .build-deps; \
168170
\
169171
# update pecl channel definitions https://github.com/docker-library/php/issues/443
170-
&& pecl update-channels \
171-
&& rm -rf /tmp/pear ~/.pearrc \
172+
pecl update-channels; \
173+
rm -rf /tmp/pear ~/.pearrc; \
172174
# smoke test
173-
&& php --version
175+
php --version
174176

175177
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
176178

177179
ENTRYPOINT ["docker-php-entrypoint"]
178180
##<autogenerated>##
179181
WORKDIR /var/www/html
180182

181-
RUN set -ex \
182-
&& cd /usr/local/etc \
183-
&& if [ -d php-fpm.d ]; then \
183+
RUN set -ex; \
184+
cd /usr/local/etc; \
185+
if [ -d php-fpm.d ]; then \
184186
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
185187
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
186188
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
@@ -192,8 +194,8 @@ RUN set -ex \
192194
echo '[global]'; \
193195
echo 'include=etc/php-fpm.d/*.conf'; \
194196
} | tee php-fpm.conf; \
195-
fi \
196-
&& { \
197+
fi; \
198+
{ \
197199
echo '[global]'; \
198200
echo 'error_log = /proc/self/fd/2'; \
199201
echo; \
@@ -205,8 +207,8 @@ RUN set -ex \
205207
echo; \
206208
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
207209
echo 'catch_workers_output = yes'; \
208-
} | tee php-fpm.d/docker.conf \
209-
&& { \
210+
} | tee php-fpm.d/docker.conf; \
211+
{ \
210212
echo '[global]'; \
211213
echo 'daemonize = no'; \
212214
echo; \

7.1/alpine3.10/zts/Dockerfile

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ RUN apk add --no-cache \
2929
openssl
3030

3131
# ensure www-data user exists
32-
RUN set -x \
33-
&& addgroup -g 82 -S www-data \
34-
&& adduser -u 82 -D -S -G www-data www-data
32+
RUN set -xe; \
33+
addgroup -g 82 -S www-data; \
34+
adduser -u 82 -D -S -G www-data www-data
3535
# 82 is the standard uid/gid for "www-data" in Alpine
3636
# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable
3737
# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable
@@ -70,13 +70,12 @@ RUN set -xe; \
7070
\
7171
apk add --no-cache --virtual .fetch-deps \
7272
gnupg \
73-
wget \
7473
; \
7574
\
7675
mkdir -p /usr/src; \
7776
cd /usr/src; \
7877
\
79-
wget -O php.tar.xz "$PHP_URL"; \
78+
curl -fsSL -o php.tar.xz "$PHP_URL"; \
8079
\
8180
if [ -n "$PHP_SHA256" ]; then \
8281
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
@@ -86,7 +85,7 @@ RUN set -xe; \
8685
fi; \
8786
\
8887
if [ -n "$PHP_ASC_URL" ]; then \
89-
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
88+
curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \
9089
export GNUPGHOME="$(mktemp -d)"; \
9190
for key in $GPG_KEYS; do \
9291
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
@@ -100,23 +99,25 @@ RUN set -xe; \
10099

101100
COPY docker-php-source /usr/local/bin/
102101

103-
RUN set -xe \
104-
&& apk add --no-cache --virtual .build-deps \
102+
RUN set -xe; \
103+
apk add --no-cache --virtual .build-deps \
105104
$PHPIZE_DEPS \
106105
coreutils \
107106
curl-dev \
108107
libedit-dev \
109108
libxml2-dev \
110109
openssl-dev \
111110
sqlite-dev \
111+
; \
112112
\
113-
&& export CFLAGS="$PHP_CFLAGS" \
113+
export CFLAGS="$PHP_CFLAGS" \
114114
CPPFLAGS="$PHP_CPPFLAGS" \
115115
LDFLAGS="$PHP_LDFLAGS" \
116-
&& docker-php-source extract \
117-
&& cd /usr/src/php \
118-
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
119-
&& ./configure \
116+
; \
117+
docker-php-source extract; \
118+
cd /usr/src/php; \
119+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
120+
./configure \
120121
--build="$gnuArch" \
121122
--with-config-file-path="$PHP_INI_DIR" \
122123
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
@@ -144,33 +145,34 @@ RUN set -xe \
144145
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
145146
\
146147
$PHP_EXTRA_CONFIGURE_ARGS \
147-
&& make -j "$(nproc)" \
148-
&& find -type f -name '*.a' -delete \
149-
&& make install \
150-
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
151-
&& make clean \
148+
; \
149+
make -j "$(nproc)"; \
150+
find -type f -name '*.a' -delete; \
151+
make install; \
152+
{ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \
153+
make clean; \
152154
\
153155
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
154-
&& cp -v php.ini-* "$PHP_INI_DIR/" \
156+
cp -v php.ini-* "$PHP_INI_DIR/"; \
155157
\
156-
&& cd / \
157-
&& docker-php-source delete \
158+
cd /; \
159+
docker-php-source delete; \
158160
\
159-
&& runDeps="$( \
161+
runDeps="$( \
160162
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
161163
| tr ',' '\n' \
162164
| sort -u \
163165
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
164-
)" \
165-
&& apk add --no-cache $runDeps \
166+
)"; \
167+
apk add --no-cache $runDeps; \
166168
\
167-
&& apk del --no-network .build-deps \
169+
apk del --no-network .build-deps; \
168170
\
169171
# update pecl channel definitions https://github.com/docker-library/php/issues/443
170-
&& pecl update-channels \
171-
&& rm -rf /tmp/pear ~/.pearrc \
172+
pecl update-channels; \
173+
rm -rf /tmp/pear ~/.pearrc; \
172174
# smoke test
173-
&& php --version
175+
php --version
174176

175177
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
176178

0 commit comments

Comments
 (0)