Skip to content

Commit

Permalink
Add JQ as a dependency + install extra extensions from volker.json (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomb1n0 authored Jun 14, 2024
1 parent 5ef782d commit 99c3e9e
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion php-71/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-72/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-73/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-74/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-80/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-81/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-82/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
2 changes: 1 addition & 1 deletion php-83/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY /resources/config/php/ /docker-config/
COPY /resources/scripts/php/install_* /docker-scripts/

# Run Installation Scripts
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client imagemagick
RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client imagemagick jq
RUN install-php-extensions mysqli \
pdo_mysql \
mbstring \
Expand Down
34 changes: 33 additions & 1 deletion resources/scripts/php/root-start-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,36 @@ if [ -f "/home/www/.config/volker/certs/volker-ca.pem" ]; then
fi

echo "Adding .vimrc";
echo "syntax on" >> /home/www/.vimrc;
echo "syntax on" >> /home/www/.vimrc;

# Using jq, fish the extra php extensions out of volker.json and install them
install_extensions_from_volker_json() {
if [ ! -f '/var/www/volker.json' ]; then
return 0;
fi

echo 'Attempting to install custom extensions'

# Parse the extra extensions out of volker.json first
extensions=$(jq -r '.extra_php_extensions | join(" ")' /var/www/volker.json)

if [ $? -ne 0 ]; then
echo "Failed to parse extra extensions out of JSON."

return 1
fi


if [ -z "$extensions" ]; then
echo "No extensions found to install."

return 0;
fi

echo "Attempting to install extensions: '$extensions'"

# Run the install-php-extensions command
install-php-extensions $extensions
}

install_extensions_from_volker_json

0 comments on commit 99c3e9e

Please sign in to comment.