0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Hướng dẫn copy dữ liệu từ docker container ra localhost

Posted at

Copy dữ liệu từ docker data volume ra localhost

Show tất cả các container

Screen Shot 2016-05-29 at 10.59.25.png

Copy dữ liệu từ docker data volume ra localhost

$ docker cp magento2_appdata_1:/srv/www ./code

Sync dữ liệu giữa local và container

mở file docker-compose.yml

$ vim docker-compose.yml

Sửa dữ liệu như bên dưới (thêm cái dòng ./code/vendor:/srv/www/vendor):

appdata:
  image: tianon/true
  volumes:
    - /srv/www
#    - ~/.composer:/var/www/.composer
    - ./code/vendor:/srv/www/vendor

Khởi động lại container để mount dữ liệu

$ docker-compose up -d app

Khi đó thì dữ liệu đã được mount giữa thư mục /srv/www/vendor ở trong docker container và thư mục ./code/vendor ở localhost

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?