简体   繁体   English

将 Docker 容器链接到卷

[英]Link Docker Container to Volumes

I currently have a codebase for Drupal using Drupal-VM vagrant box and VirtualBox.我目前有一个使用 Drupal-VM vagrant 盒子和 VirtualBox 的 Drupal 代码库。 I would like to migrate to docker but I am unaware on how to integrate it with my existing code base.我想迁移到 docker 但我不知道如何将它与我现有的代码库集成。

Can anyone help me?谁能帮我? I have followed instructions from Docker Hub - Drupal Install Steps and MySQL and Drupal Container to spin up mysql and Drupal images but how do I make it point to my pre-existing codebase? I have followed instructions from Docker Hub - Drupal Install Steps and MySQL and Drupal Container to spin up mysql and Drupal images but how do I make it point to my pre-existing codebase?


Previous posts with more Details, Questions and Background:以前的帖子有更多细节、问题和背景:

after spinning up the docker container you can copy the existing code to the container using docker cp docker cp docs在启动 docker 容器后,您可以使用docker cp docker cp docs将现有代码复制到容器

as far as the database you can just import it to the mysql container至于数据库,您可以将其导入 mysql 容器

to link the container to a volume use the -v flag when starting the container将容器链接到卷,在启动容器时使用-v标志

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM