Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMD php -a; replace awk with magic bash #2

Merged
merged 1 commit into from
Sep 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 5.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ RUN set -x \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove autoconf2.13 curl \
&& rm -r /usr/src/php

CMD ["php", "-a"]
2 changes: 2 additions & 0 deletions 5.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ RUN set -x \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove curl \
&& rm -r /usr/src/php

CMD ["php", "-a"]
2 changes: 2 additions & 0 deletions 5.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ RUN set -x \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove curl \
&& rm -r /usr/src/php

CMD ["php", "-a"]
2 changes: 2 additions & 0 deletions 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ RUN set -x \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove curl \
&& rm -r /usr/src/php

CMD ["php", "-a"]
1 change: 0 additions & 1 deletion Dockerfile-apache-tail
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

ENV PATH $PATH:/usr/local/apache2/bin

WORKDIR /var/www/html
Expand Down
7 changes: 5 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ for version in "${versions[@]}"; do
exit 1
fi

insert="$(cat "Dockerfile-apache-insert" | sed 's/[\]/\\&/g')"
dockerfile="$( cat "$version/Dockerfile")"
apacheInsert="$(cat "Dockerfile-apache-insert")"
apacheTail="$(cat "Dockerfile-apache-tail")"
(
set -x
sed -ri '
s/^(ENV PHP_VERSION) .*/\1 '"$fullVersion"'/;
s/^(RUN gpg .* --recv-keys) [0-9a-fA-F ]*$/\1 '"$gpgKey"'/
' "$version/Dockerfile"

awk -vf2="$insert" '/^\t&& make install \\$/{print f2;next}1' "$version/Dockerfile" "Dockerfile-apache-tail" > "$version/apache/Dockerfile"
apacheDockerfile="${dockerfile/?\&\& make install \\/$apacheInsert}"
echo "${apacheDockerfile/CMD*/$apacheTail}" > "$version/apache/Dockerfile"
)
done

Expand Down