Jfrog cli docker image is not persistent
Solution 1:
JFrog CLI stores its configuration inside its home directory, named .jfrog on the local system.
By default, the .jfrog directory is located under the user home directory. You have the option of changing the home directory location by setting the JFROG_CLI_HOME_DIR
environment variable.
So if you'd like JFrog CLI to access the home directory from inside a container, you'll need to mount the container's JFrog CLI home directory to the directory on the host machine. You can do this using docker's volume feature, by adding the -v option to the command as follows:
docker run -v ~/.jfrog:/home/frogger/.jfrog releases-docker.jfrog.io/jfrog/jfrog-cli-full-v2-jf jf c show
In the above command, we're mapping the host machine's ~/.jfrog
directory to the container's /home/frogger/.jfrog
directory. The releases-docker.jfrog.io/jfrog/jfrog-cli-full-v2-jf
container's user home is /home/frogger
.