forked from erseco/alpine-php-webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix iconv compatibility issue on Alpine (#47)
- Loading branch information
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
ARG ARCH= | ||
FROM ${ARCH}alpine:3.17.3 as build | ||
|
||
# renovate: datasource=repology depName=alpine_3_13/gnu-libiconv versioning=loose | ||
ARG GNU_LIBICONV_VERSION="=1.15-r3" | ||
|
||
RUN apk --no-cache add \ | ||
# Workaround for using gnu-iconv instead of iconv in PHP on Alpine | ||
# https://github.com/docker-library/php/issues/240#issuecomment-876464325 | ||
--repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ \ | ||
gnu-libiconv${GNU_LIBICONV_VERSION} | ||
|
||
FROM ${ARCH}alpine:3.17.3 | ||
|
||
LABEL Maintainer="[email protected]" \ | ||
|
@@ -86,11 +97,16 @@ RUN apk --no-cache add \ | |
&& rm -rf /var/cache/apk/* \ | ||
# Remove default server definition | ||
&& rm /etc/nginx/http.d/default.conf \ | ||
# Make sure files/folders needed by the processes are accessable when they run under the nobody user | ||
# Make sure files/folders needed by the processes are accessible when they run under the nobody user | ||
&& chown -R nobody.nobody /run \ | ||
&& chown -R nobody.nobody /var/lib/nginx \ | ||
&& chown -R nobody.nobody /var/log/nginx | ||
|
||
# Workaround for using gnu-iconv instead of iconv in PHP on Alpine | ||
# https://github.com/docker-library/php/issues/240#issuecomment-876464325 | ||
COPY --from=build /usr/lib/preloadable_libiconv.so /usr/lib/preloadable_libiconv.so | ||
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so | ||
|
||
# Add configuration files | ||
COPY --chown=nobody rootfs/ / | ||
|
||
|