I recently set up a magento2 dev environment with Docker as identified on magento.com. However after installing new extensions I cannot run setup:upgrade or static-content deploy. Is this because of an internal domain name not being set or a db connection issues? Below are my CLI errors.

  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodena  
  me nor servname provided, or not known 

  Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed:   
  nodename nor servname provided, or not known in /Users/devmac03/Desktop/mvp  
  bstract.php on line 129

1 Answer 1


You need access your container using:

docker exec -ti CONTAINER_NAME bash

To discover the name use docker ps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.