jeudi 30 juin 2016

PDOException SQLSTATE[HY000] [2002] No such file or directory. Whilst running laravel via isolated docker containers

Trying to run laravel via docker containers. So, isolated containers include artisan, mariadb, phpfpm, phpmyadmin, data, and storage containers.

These containers are connected via links, the data container stores laravel files, and the storage container is meant to store the database files; thus, both act as the volume to other containers.

The mariadb container runs of the stock mariadb container provided on the docker hub repository. Artisan and phpfpm containers are based on the image provided by dylanlindgren on the docker hub repository.

The artisan container is linked to the db container, with the following command:

docker run --privileged=true --volumes-from myapp-data  --link myapp-db --rm ayoolaosun/docker-laravel-artisan. 

However, when running the artisan migrate command, the following error pops up:

"PDOException SQLSTATE[HY000] [2002] No such file or directory". 

I recently learnt about containers and am very new to devOps, so I am not sure what to tweak in the containers to solve the problem. Thanks, any tips will do.

Aucun commentaire:

Enregistrer un commentaire