Skip to content

Commit

Permalink
Fix iconv compatibility issue on Alpine (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsihk authored Apr 8, 2023
1 parent 21f7b8b commit 41fb394
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Dockerfile
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]" \
Expand Down Expand Up @@ -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/ /

Expand Down

0 comments on commit 41fb394

Please sign in to comment.