diff --git a/README.md b/README.md index a4976ac..5be1ef7 100644 --- a/README.md +++ b/README.md @@ -295,5 +295,28 @@ systemctl restart docker - `mvn docker:logs` - `mvn docker:logs -Ddocker.follow` +#### 34.6 Persisting images to EC2 filesystem +1. Initial state + - `docker container exec -it b36 bash` + - `pwd` -> /application + - `cd ~` -> `pwd` -> /root + - `ls` -> supportportal + - `ls supportportal/user` -> folders of users like `{UUID}` +2. State after rebooting EC2 instance + - same docker container + - `docker container exec -it b36 bash` + - `ls /root/supportportal/user` -> all left the same +3. State after recreating container (or new image) + - `mvn docker:stop docker:start` + - other container + - `docker container exec -it bc7 bash` + - **or** + - `docker container exec -it angular-support-portal-backend bash` + - `ls /root/supportportal/user` -> **No such file or directory** +4. Adding volume to store images between rebuilds + - add `/root/supportportal` - not successful + - add `~/supportportal:/root/supportportal` - Error + - `'~/supportportal' cannot be relativized, cannot resolve arbitrary user home paths.` + - add `/home/ec2-user/supportportal:/root/supportportal` - success diff --git a/support-portal-backend/pom.xml b/support-portal-backend/pom.xml index 3b628b7..bc5d91e 100644 --- a/support-portal-backend/pom.xml +++ b/support-portal-backend/pom.xml @@ -192,6 +192,11 @@ always + + + /home/ec2-user/supportportal:/root/supportportal + +