Skip to content

Commit 2399c4f

Browse files
ReactDevs007web-flow
authored andcommitted
Merge pull request #605 from infosiftr/shared-sodium
Update sodium extension to be shared (so it can be replaced if necessary by users)
2 parents aec9b46 + 94c4827 commit 2399c4f

File tree

13 files changed

+56
-12
lines changed

13 files changed

+56
-12
lines changed

7.2/alpine3.6/cli/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ RUN set -xe \
122122
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
123123
--enable-mysqlnd \
124124
# https://wiki.php.net/rfc/libsodium
125-
--with-sodium \
125+
--with-sodium=shared \
126126
\
127127
--with-curl \
128128
--with-libedit \
@@ -157,6 +157,9 @@ RUN set -xe \
157157

158158
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
159159

160+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
161+
RUN docker-php-ext-enable sodium
162+
160163
ENTRYPOINT ["docker-php-entrypoint"]
161164
##<autogenerated>##
162165
CMD ["php", "-a"]

7.2/alpine3.6/fpm/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RUN set -xe \
123123
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
124124
--enable-mysqlnd \
125125
# https://wiki.php.net/rfc/libsodium
126-
--with-sodium \
126+
--with-sodium=shared \
127127
\
128128
--with-curl \
129129
--with-libedit \
@@ -158,6 +158,9 @@ RUN set -xe \
158158

159159
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
160160

161+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
162+
RUN docker-php-ext-enable sodium
163+
161164
ENTRYPOINT ["docker-php-entrypoint"]
162165
##<autogenerated>##
163166
WORKDIR /var/www/html

7.2/alpine3.6/zts/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RUN set -xe \
123123
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
124124
--enable-mysqlnd \
125125
# https://wiki.php.net/rfc/libsodium
126-
--with-sodium \
126+
--with-sodium=shared \
127127
\
128128
--with-curl \
129129
--with-libedit \
@@ -158,6 +158,9 @@ RUN set -xe \
158158

159159
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
160160

161+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
162+
RUN docker-php-ext-enable sodium
163+
161164
ENTRYPOINT ["docker-php-entrypoint"]
162165
##<autogenerated>##
163166
CMD ["php", "-a"]

7.2/alpine3.7/cli/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ RUN set -xe \
122122
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
123123
--enable-mysqlnd \
124124
# https://wiki.php.net/rfc/libsodium
125-
--with-sodium \
125+
--with-sodium=shared \
126126
\
127127
--with-curl \
128128
--with-libedit \
@@ -157,6 +157,9 @@ RUN set -xe \
157157

158158
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
159159

160+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
161+
RUN docker-php-ext-enable sodium
162+
160163
ENTRYPOINT ["docker-php-entrypoint"]
161164
##<autogenerated>##
162165
CMD ["php", "-a"]

7.2/alpine3.7/fpm/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RUN set -xe \
123123
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
124124
--enable-mysqlnd \
125125
# https://wiki.php.net/rfc/libsodium
126-
--with-sodium \
126+
--with-sodium=shared \
127127
\
128128
--with-curl \
129129
--with-libedit \
@@ -158,6 +158,9 @@ RUN set -xe \
158158

159159
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
160160

161+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
162+
RUN docker-php-ext-enable sodium
163+
161164
ENTRYPOINT ["docker-php-entrypoint"]
162165
##<autogenerated>##
163166
WORKDIR /var/www/html

7.2/alpine3.7/zts/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RUN set -xe \
123123
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
124124
--enable-mysqlnd \
125125
# https://wiki.php.net/rfc/libsodium
126-
--with-sodium \
126+
--with-sodium=shared \
127127
\
128128
--with-curl \
129129
--with-libedit \
@@ -158,6 +158,9 @@ RUN set -xe \
158158

159159
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
160160

161+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
162+
RUN docker-php-ext-enable sodium
163+
161164
ENTRYPOINT ["docker-php-entrypoint"]
162165
##<autogenerated>##
163166
CMD ["php", "-a"]

7.2/stretch/apache/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ RUN set -eux; \
204204
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
205205
--with-password-argon2 \
206206
# https://wiki.php.net/rfc/libsodium
207-
--with-sodium \
207+
--with-sodium=shared \
208208
\
209209
--with-curl \
210210
--with-libedit \
@@ -246,6 +246,9 @@ RUN set -eux; \
246246

247247
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
248248

249+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
250+
RUN docker-php-ext-enable sodium
251+
249252
ENTRYPOINT ["docker-php-entrypoint"]
250253
##<autogenerated>##
251254
COPY apache2-foreground /usr/local/bin/

7.2/stretch/cli/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ RUN set -eux; \
145145
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
146146
--with-password-argon2 \
147147
# https://wiki.php.net/rfc/libsodium
148-
--with-sodium \
148+
--with-sodium=shared \
149149
\
150150
--with-curl \
151151
--with-libedit \
@@ -187,6 +187,9 @@ RUN set -eux; \
187187

188188
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
189189

190+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
191+
RUN docker-php-ext-enable sodium
192+
190193
ENTRYPOINT ["docker-php-entrypoint"]
191194
##<autogenerated>##
192195
CMD ["php", "-a"]

7.2/stretch/fpm/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ RUN set -eux; \
146146
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
147147
--with-password-argon2 \
148148
# https://wiki.php.net/rfc/libsodium
149-
--with-sodium \
149+
--with-sodium=shared \
150150
\
151151
--with-curl \
152152
--with-libedit \
@@ -188,6 +188,9 @@ RUN set -eux; \
188188

189189
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
190190

191+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
192+
RUN docker-php-ext-enable sodium
193+
191194
ENTRYPOINT ["docker-php-entrypoint"]
192195
##<autogenerated>##
193196
WORKDIR /var/www/html

7.2/stretch/zts/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ RUN set -eux; \
146146
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
147147
--with-password-argon2 \
148148
# https://wiki.php.net/rfc/libsodium
149-
--with-sodium \
149+
--with-sodium=shared \
150150
\
151151
--with-curl \
152152
--with-libedit \
@@ -188,6 +188,9 @@ RUN set -eux; \
188188

189189
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
190190

191+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
192+
RUN docker-php-ext-enable sodium
193+
191194
ENTRYPOINT ["docker-php-entrypoint"]
192195
##<autogenerated>##
193196
CMD ["php", "-a"]

Dockerfile-alpine.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ RUN set -xe \
116116
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
117117
--enable-mysqlnd \
118118
# https://wiki.php.net/rfc/libsodium
119-
--with-sodium \
119+
--with-sodium=shared \
120120
\
121121
--with-curl \
122122
--with-libedit \
@@ -151,6 +151,9 @@ RUN set -xe \
151151

152152
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
153153

154+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
155+
RUN docker-php-ext-enable sodium
156+
154157
ENTRYPOINT ["docker-php-entrypoint"]
155158
##<autogenerated>##
156159
CMD ["php", "-a"]

Dockerfile-debian.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ RUN set -eux; \
139139
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
140140
--with-password-argon2 \
141141
# https://wiki.php.net/rfc/libsodium
142-
--with-sodium \
142+
--with-sodium=shared \
143143
\
144144
--with-curl \
145145
--with-libedit \
@@ -181,6 +181,9 @@ RUN set -eux; \
181181

182182
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
183183

184+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
185+
RUN docker-php-ext-enable sodium
186+
184187
ENTRYPOINT ["docker-php-entrypoint"]
185188
##<autogenerated>##
186189
CMD ["php", "-a"]

update.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ for version in "${versions[@]}"; do
166166
sed -ri '/sodium/d' "$version/$suite/$variant/Dockerfile"
167167
fi
168168

169+
# remove any _extra_ blank lines created by the deletions above
170+
awk '
171+
NF > 0 { blank = 0 }
172+
NF == 0 { ++blank }
173+
blank < 2 { print }
174+
' "$version/$suite/$variant/Dockerfile" > "$version/$suite/$variant/Dockerfile.new"
175+
mv "$version/$suite/$variant/Dockerfile.new" "$version/$suite/$variant/Dockerfile"
176+
169177
# automatic `-slim` for stretch
170178
# TODO always add slim once jessie is removed
171179
sed -ri \

0 commit comments

Comments
 (0)