Closed kb7791 closed 4 years ago
@kb7791
artifactory_data
?
3b. Recommend to place old data in a fully accessible folder and then mount it to /var/opt/jfrog/artifactory
chown-R 1030:1030 <on the host mounted directory>
Let us know if this worked.
@JfrogPrasanna
The host directory 'Artifactory_data' is a docker named volume that is made auto-magically by docker-compose file, by default those volumes are stored in /var/lib/docker/volumes and that directory is owned by root regardless if I create them as a non-root user. So that's the issue I'm having with the artifactory user in the container trying to access the docker named volume that resides in /var/lib/docker/volumes. Having to create a local bind mount in a host directory and chown'ing the the privileges for that local bind mount, doesn't that take away from portability of the container?
I had this previously working with what you had already suggested, making directories on my local machine and giving them 1030:1030 permissions, but i was tasked to migrate to docker-volumes and since /var/lib/docker/volumes is set to root permission I would think it would be bad practice to chown that directory
@kb7791 in that case, are you ok for the container to run as root. If so you can pass user: "0:0"
for artifactory service in your docker-compose.
This can be closed, ended up taking the route of creating a full system export on the old vm and using to restore a new instance on the new VM, might be the long way route but it seemed to work without any issues
So I initially had my docker-compose file mounting to a local directory on the host machine and I was tasked to convert it to using docker-volumes. So I made changes to my docker-compose file to the following. Basically just added the reference to the volume in each service and then created that top level volumes: section and set both to external: false. This was the original compose file.
And this is the compose file after my changes to use docker-volumes.
I run docker-compose up with no issues and the Artifactory platform launch with no data as i expected since all the data resides still on the host directory.
My next step was using
docker cp /old/local/host/mount/artifactory/. artifactory:/var/opt/jfrog/artifactory
anddocker cp /old/local/host/mount/postgresql/. postgresql:/var/lib/posgresql/data
Once these copies were done I then ran docker-compose down, assuming that the copied data was mounted to the docker-volumes I created and then ran docker-compose up and got the following stack trace.
Not sure what I did wrong here or if I missed a step in my compose file or I'm having some other underlying issue. I did things this way because I didnt want to lose any of the data that was already residing in the local host directory. This also worked fine and still does if I revert to using local host points but I need to change it to use docker-volumes. Trying to get this all updated prior to upgrading to Artifactory Pro 7.3.2.