mirror of
https://github.com/danog/php.git
synced 2024-11-29 20:19:12 +01:00
Add simple initial entrypoint for supporting "docker run php --flags"
This commit is contained in:
parent
35080ccd4c
commit
703ba52e0c
@ -127,8 +127,9 @@ RUN set -xe \
|
|||||||
\
|
\
|
||||||
&& apk del .build-deps
|
&& apk del .build-deps
|
||||||
|
|
||||||
COPY docker-php-ext-* /usr/local/bin/
|
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-php-entrypoint"]
|
||||||
##<autogenerated>##
|
##<autogenerated>##
|
||||||
CMD ["php", "-a"]
|
CMD ["php", "-a"]
|
||||||
##</autogenerated>##
|
##</autogenerated>##
|
||||||
|
@ -117,8 +117,9 @@ RUN set -xe \
|
|||||||
\
|
\
|
||||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps
|
||||||
|
|
||||||
COPY docker-php-ext-* /usr/local/bin/
|
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-php-entrypoint"]
|
||||||
##<autogenerated>##
|
##<autogenerated>##
|
||||||
CMD ["php", "-a"]
|
CMD ["php", "-a"]
|
||||||
##</autogenerated>##
|
##</autogenerated>##
|
||||||
|
9
docker-php-entrypoint
Executable file
9
docker-php-entrypoint
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# first arg is `-f` or `--some-option`
|
||||||
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
set -- php "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
28
update.sh
28
update.sh
@ -106,14 +106,20 @@ for version in "${versions[@]}"; do
|
|||||||
dockerfiles=()
|
dockerfiles=()
|
||||||
|
|
||||||
{ generated_warning; cat Dockerfile-debian.template; } > "$version/Dockerfile"
|
{ generated_warning; cat Dockerfile-debian.template; } > "$version/Dockerfile"
|
||||||
cp -v docker-php-ext-* "$version/"
|
cp -v \
|
||||||
cp -v docker-php-source "$version/"
|
docker-php-entrypoint \
|
||||||
|
docker-php-ext-* \
|
||||||
|
docker-php-source \
|
||||||
|
"$version/"
|
||||||
dockerfiles+=( "$version/Dockerfile" )
|
dockerfiles+=( "$version/Dockerfile" )
|
||||||
|
|
||||||
if [ -d "$version/alpine" ]; then
|
if [ -d "$version/alpine" ]; then
|
||||||
{ generated_warning; cat Dockerfile-alpine.template; } > "$version/alpine/Dockerfile"
|
{ generated_warning; cat Dockerfile-alpine.template; } > "$version/alpine/Dockerfile"
|
||||||
cp -v docker-php-ext-* "$version/alpine/"
|
cp -v \
|
||||||
cp -v docker-php-source "$version/alpine/"
|
docker-php-entrypoint \
|
||||||
|
docker-php-ext-* \
|
||||||
|
docker-php-source \
|
||||||
|
"$version/alpine/"
|
||||||
dockerfiles+=( "$version/alpine/Dockerfile" )
|
dockerfiles+=( "$version/alpine/Dockerfile" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -138,8 +144,11 @@ for version in "${versions[@]}"; do
|
|||||||
ia { ac++ }
|
ia { ac++ }
|
||||||
ia && ac == 1 { system("cat '$variant'-Dockerfile-block-" ab) }
|
ia && ac == 1 { system("cat '$variant'-Dockerfile-block-" ab) }
|
||||||
' "$base" > "$version/$target/Dockerfile"
|
' "$base" > "$version/$target/Dockerfile"
|
||||||
cp -v docker-php-ext-* "$version/$target/"
|
cp -v \
|
||||||
cp -v docker-php-source "$version/$target/"
|
docker-php-entrypoint \
|
||||||
|
docker-php-ext-* \
|
||||||
|
docker-php-source \
|
||||||
|
"$version/$target/"
|
||||||
dockerfiles+=( "$version/$target/Dockerfile" )
|
dockerfiles+=( "$version/$target/Dockerfile" )
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -155,6 +164,13 @@ for version in "${versions[@]}"; do
|
|||||||
"${dockerfiles[@]}"
|
"${dockerfiles[@]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# update entrypoint commands
|
||||||
|
for dockerfile in "${dockerfiles[@]}"; do
|
||||||
|
cmd="$(awk '$1 == "CMD" { $1 = ""; print }' "$dockerfile" | tail -1 | jq --raw-output '.[0]')"
|
||||||
|
entrypoint="$(dirname "$dockerfile")/docker-php-entrypoint"
|
||||||
|
sed -i 's! php ! '"$cmd"' !g' "$entrypoint"
|
||||||
|
done
|
||||||
|
|
||||||
newTravisEnv=
|
newTravisEnv=
|
||||||
for dockerfile in "${dockerfiles[@]}"; do
|
for dockerfile in "${dockerfiles[@]}"; do
|
||||||
dir="${dockerfile%Dockerfile}"
|
dir="${dockerfile%Dockerfile}"
|
||||||
|
Loading…
Reference in New Issue
Block a user