1. The original intention of Docker is to make the container stateless, that is, use whatever is in the box. We will not make any external modifications. If I need to change the code, I will rebuild an image.
2. For the need to modify the source code, you can associate the changing directory through volume, that is, the directory mount in the container is associated with a directory on the external host.
Data volume mapping is recommended during the deployment test phase to facilitate frequent modifications; mirroring is recommended during the production environment deployment phase to facilitate batch deployment.
The second floor is already complete, let’s talk about one more: docker exec -ti app bash
Then go in and make any changes you want and then exit
Make data volume mapping, or directly enter the container
Containers are isolated
1. The original intention of Docker is to make the container stateless, that is, use whatever is in the box. We will not make any external modifications. If I need to change the code, I will rebuild an image.
2. For the need to modify the source code, you can associate the changing directory through volume, that is, the directory mount in the container is associated with a directory on the external host.
Data volume mapping is recommended during the deployment test phase to facilitate frequent modifications; mirroring is recommended during the production environment deployment phase to facilitate batch deployment.