09-24-2020 04:21 PM
Hi,
I am trying to copy the alfresco related folders to local from the docker container(usr/local/tomcat ).
Is there a better way to do that?
09-24-2020 05:01 PM
If i understand correctly that you want to keep the copy of folders on host, you can use bind mounts to do that. It will automatically create specified folders and keep the folders up to date with containers.
Here is an example of docker-compose services, read my comments in highlighted part:
version: '2' services: acs62-aio-demo-project-share: image: alfresco-share-acs62-aio-demo-project:development mem_limit: 1g .....
....... volumes: #Bind mount SHORT SYNTAX - [SOURCE:]TARGET[:MODE] #SOURCE can be a named volume or a (relative or absolute) path on the host system. #TARGET is an absolute path in the container where the volume is mounted. #MODE is a mount option which can be read-only (ro) or read-write (rw) (default). - ../../../logs/share:/usr/local/tomcat/logs acs62-aio-demo-project-acs: image: alfresco-content-services-acs62-aio-demo-project:development mem_limit: 1700m ...
..... volumes: #Bind mount SHORT SYNTAX - [SOURCE:]TARGET[:MODE] #SOURCE can be a named volume or a (relative or absolute) path on the host system. #TARGET is an absolute path in the container where the volume is mounted. #MODE is a mount option which can be read-only (ro) or read-write (rw) (default). - ../../../data/alfresco/alf_data:/usr/local/tomcat/alf_data - ../../../logs/alfresco:/usr/local/tomcat/logs
......
......
09-25-2020 09:31 AM
Thank you Abhinav. If someone already ran the images is there is any option to copy the entire alfresco folder structure to our local system .
docker cp alfresco_1:/usr/local/tomcat <destination>
the above command copy only the amps folders and not the webapps or shared folders.
09-26-2020 11:36 AM
As said you can try to map /usr/local/tomcat folder inside the container to a directory in the host ,like following.
Then you an do whatever you want
volumes:
- /your host folder:/usr/local/tomcat
09-28-2020 01:56 PM
yes but note that, if you are using windows host, tomcat startup script may fail to start as it will try to execute ".sh" script. I have not tried but most likely error is expected on windos host.
09-28-2020 04:16 PM
My thorts it is some permisions or storage problem.
sudo docker cp alfresco_1:/usr/local/tomcat <local_folder>
must copy all folders and files from '/usr/local/tomcat' including mapped persistant volume alf_data.
Go to your containre and check the folders you try to copy:
sudo docker exec -it alfresco_1 bash
cd /usr/local/tomcat
ls -la
Try copy folder by folder
sudo docker cp alfresco_1:/usr/local/tomcat/shared <local_folder/shared> sudo docker cp alfresco_1:/usr/local/tomcat/webapps <local_folder/webapps>
and get some errors.
p.s. docker is natural linux. dont use wondows.
Explore our Alfresco products with the links below. Use labels to filter content by product module.