Skip to content

Commit

Permalink
Install "mariadb-client" package for MariaDB users (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed May 16, 2024
1 parent c4fcfa4 commit a8e4e74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtimes/8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LABEL maintainer="Taylor Otwell"

ARG WWWGROUP
ARG NODE_VERSION=20
ARG MYSQL_CLIENT="mysql-client"
ARG POSTGRES_VERSION=15

WORKDIR /var/www/html
Expand Down Expand Up @@ -44,7 +45,7 @@ RUN apt-get update \
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y $MYSQL_CLIENT \
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
&& apt-get -y autoremove \
&& apt-get clean \
Expand Down
5 changes: 5 additions & 0 deletions src/Console/Concerns/InteractsWithDockerComposeServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ protected function buildDockerCompose(array $services)
? Yaml::parseFile($composePath)
: Yaml::parse(file_get_contents(__DIR__ . '/../../../stubs/docker-compose.stub'));

// Prepare the installation of the "mariadb-client" package if the MariaDB service is used...
if (in_array('mariadb', $services)) {
$compose['services']['laravel.test']['build']['args']['MYSQL_CLIENT'] = 'mariadb-client';
}

// Adds the new services as dependencies of the laravel.test service...
if (! array_key_exists('laravel.test', $compose['services'])) {
$this->warn('Couldn\'t find the laravel.test service. Make sure you add ['.implode(',', $services).'] to the depends_on config.');
Expand Down

0 comments on commit a8e4e74

Please sign in to comment.