问题
When i do df -h
inside my container i get this
Filesystem Size Used Avail Use% Mounted on
overlay 30G 1.9G 28G 7% /
tmpfs 64M 0 64M 0% /dev
tmpfs 492M 0 492M 0% /sys/fs/cgroup
/dev/xvda1 30G 1.9G 28G 7% /etc/hosts
shm 64M 0 64M 0% /dev/shm
:/ 8.0E 52M 8.0E 1% /var/www/html
tmpfs 492M 0 492M 0% /proc/acpi
tmpfs 492M 0 492M 0% /proc/scsi
tmpfs 492M 0 492M 0% /sys/firmware
Scenario
I am running wordpress in my container so when i install it i think it gets installed in either overlay
or /dev/xvda1
which is the root volume of my ECS instance which it is running on (EBS 30gb)
Problem
What is happening is that when i terminate the ECS
instance and launch a new one through autoscaling groups
i lose my installation (obviously since EBS
volume gets terminated)
Question
Is there any way i can change where my wordpress is installed so it persists say maybe a EFS
mount
Basically i want to change the installation directory so it is not dependent on EBS
but EFS
So when i run the container in any Instance that way my installation persists :)
Note
I have already mounted EFS
on var/www/html so mounting EFS
on container for persistant storage is not a problem i can simply mount another EFS
if there is a way to change the installation directory that is where my wordpress gets installed
Any help is highly appreciated thanks :)
来源:https://stackoverflow.com/questions/60123804/how-to-change-the-directory-where-my-docker-image-is-installed-inside-a-containe