Skip to content

Commit

Permalink
fix iconv (#13)
Browse files Browse the repository at this point in the history
* fix iconv

* add library to php7-debug
  • Loading branch information
Harry Bragg authored Nov 7, 2017
1 parent 64cf9b8 commit aa8dbd1
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 6 deletions.
7 changes: 6 additions & 1 deletion 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ RUN apk add --no-cache \
php5-xml \
php5-xmlreader \
php5-zip \
php5-zlib
php5-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php5-dev php5-pear \
Expand All @@ -63,3 +65,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
7 changes: 6 additions & 1 deletion 5.6/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ RUN apk add --no-cache \
php5-xml \
php5-xmlreader \
php5-zip \
php5-zlib
php5-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php5-dev php5-pear \
Expand Down Expand Up @@ -66,3 +68,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
17 changes: 17 additions & 0 deletions 5.6/php5.6.bats
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,20 @@ readonly container="graze/php-alpine:5.6"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}
17 changes: 17 additions & 0 deletions 5.6/php5.6_debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,20 @@ readonly container="graze/php-alpine:5.6-test"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}
7 changes: 6 additions & 1 deletion 7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ RUN apk add --no-cache \
php7-xml \
php7-xmlreader \
php7-zip \
php7-zlib
php7-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php7-dev php7-pear \
Expand Down Expand Up @@ -72,3 +74,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
7 changes: 6 additions & 1 deletion 7.0/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ RUN apk add --no-cache \
php7-xml \
php7-xmlreader \
php7-zip \
php7-zlib
php7-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php7-dev php7-pear \
Expand Down Expand Up @@ -73,3 +75,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
17 changes: 17 additions & 0 deletions 7.0/php7.0.bats
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,20 @@ readonly container="graze/php-alpine:7.0"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}
17 changes: 17 additions & 0 deletions 7.0/php7.0_debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,20 @@ readonly container="graze/php-alpine:7.0-test"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}
7 changes: 6 additions & 1 deletion 7.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ RUN apk add --no-cache \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
php7-zlib
php7-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php7-dev php7-pear \
Expand All @@ -73,3 +75,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
7 changes: 6 additions & 1 deletion 7.1/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ RUN apk add --no-cache \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
php7-zlib
php7-zlib \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
gnu-libiconv

# install and remove building packages
ENV PHPIZE_DEPS autoconf file g++ gcc libc-dev make pkgconf re2c php7-dev php7-pear \
Expand All @@ -74,3 +76,6 @@ ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
17 changes: 17 additions & 0 deletions 7.1/php7.1.bats
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,20 @@ readonly container="graze/php-alpine:7.1"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}
17 changes: 17 additions & 0 deletions 7.1/php7.1_debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,20 @@ readonly container="graze/php-alpine:7.1-test"
[ "$status" -eq 0 ]
[ "$output" = "memory_limit => 1024M => 1024M" ]
}

@test "the image uses a fixed iconv module" {
run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'"
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]]
}

@test "iconv works" {
run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");'
echo "status: $status"
echo "output: $output"
[ "$status" -eq 0 ]
[ "$output" = "foobar" ]
[[ "${output}" != *"PHP Notice"* ]]
}

0 comments on commit aa8dbd1

Please sign in to comment.