handle docker container data while developing wep application -


i pulled image magento2 installation.

now trying container /var/www/html data in host after can handle phpstorm.

i tried overwrite in container /var/www/html

docker run --name development-phase -d -p 5000:80 -v /u01/magento2:/var/www/html magento2 

while creating volume

data flows: host /u01/magento2 container /var/www/html

but looking

data flow should be container /var/www/html host /u01/magento2

i have referred stack overflow link suggest copy container data host before creating volume, in case docker cp command affect prerequisite setting of magento2 page not load properly.

that's behavior of volumes in docker:

  • -v /host/path:/container/path not copy data
  • -v /container/path copy data , creates new volume random name

so, might want try

docker run --name development-phase -d -p 5000:80 -v /var/www/html magento2 

then find out random path looking @ value of property source "destination":"/var/www/html" using docker inspect

docker inspect --format "{{json .mounts}}" development-phase 

even more readable

docker inspect -f "{{json .mounts}}" development-phase \  | jq '.[] | select(.destination | contains("/var/www/html"))' 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -