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?
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
......
......
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.
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
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.
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.