SHARE
TWEET

Untitled

a guest Oct 14th, 2019 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //download mongodb files
  2. docker pull mongo
  3.  
  4. //run mongodb container in background
  5. docker run -d -p 27017-27019:27017-27019 --name mongodb mongo:latest
  6.  
  7. //enter mongodb shell
  8. docker exec -it mongodb bash
  9.  
  10. //download php files
  11. docker pull php:5-apache
  12.  
  13. //run php container in background and link to docker
  14. docker run --name=php-mongo -d -v C:\Core\Docker:/var/www/html -p 8020:80 --link mongodb php:5-apache
  15.  
  16. //connect to php container to install mongodb connector
  17. docker exec -it `pID` bash
  18. > apt-get update
  19. > apt-get install openssl libssl-dev libcurl4-openssl-dev
  20. > pecl install mongo
  21. > echo "extension=mongo.so" > /usr/local/etc/php/conf.d/mongo.ini
  22.  
  23. //restart the container
  24. docker stop `pID`
  25. docker start `pID`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top