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
|
||||
|
||||
COPY docker-php-ext-* /usr/local/bin/
|
||||
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["docker-php-entrypoint"]
|
||||
##<autogenerated>##
|
||||
CMD ["php", "-a"]
|
||||
##</autogenerated>##
|
||||
|
@ -117,8 +117,9 @@ RUN set -xe \
|
||||
\
|
||||
&& 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>##
|
||||
CMD ["php", "-a"]
|
||||
##</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=()
|
||||
|
||||
{ generated_warning; cat Dockerfile-debian.template; } > "$version/Dockerfile"
|
||||
cp -v docker-php-ext-* "$version/"
|
||||
cp -v docker-php-source "$version/"
|
||||
cp -v \
|
||||
docker-php-entrypoint \
|
||||
docker-php-ext-* \
|
||||
docker-php-source \
|
||||
"$version/"
|
||||
dockerfiles+=( "$version/Dockerfile" )
|
||||
|
||||
if [ -d "$version/alpine" ]; then
|
||||
{ generated_warning; cat Dockerfile-alpine.template; } > "$version/alpine/Dockerfile"
|
||||
cp -v docker-php-ext-* "$version/alpine/"
|
||||
cp -v docker-php-source "$version/alpine/"
|
||||
cp -v \
|
||||
docker-php-entrypoint \
|
||||
docker-php-ext-* \
|
||||
docker-php-source \
|
||||
"$version/alpine/"
|
||||
dockerfiles+=( "$version/alpine/Dockerfile" )
|
||||
fi
|
||||
|
||||
@ -138,8 +144,11 @@ for version in "${versions[@]}"; do
|
||||
ia { ac++ }
|
||||
ia && ac == 1 { system("cat '$variant'-Dockerfile-block-" ab) }
|
||||
' "$base" > "$version/$target/Dockerfile"
|
||||
cp -v docker-php-ext-* "$version/$target/"
|
||||
cp -v docker-php-source "$version/$target/"
|
||||
cp -v \
|
||||
docker-php-entrypoint \
|
||||
docker-php-ext-* \
|
||||
docker-php-source \
|
||||
"$version/$target/"
|
||||
dockerfiles+=( "$version/$target/Dockerfile" )
|
||||
done
|
||||
|
||||
@ -155,6 +164,13 @@ for version in "${versions[@]}"; do
|
||||
"${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=
|
||||
for dockerfile in "${dockerfiles[@]}"; do
|
||||
dir="${dockerfile%Dockerfile}"
|
||||
|
Loading…
Reference in New Issue
Block a user