How to Persist JFrog CLI Config Details in a Docker Container

How to Persist JFrog CLI Config Details in a Docker Container

AuthorFullName__c
Amith Kumar Mutakari
articleNumber
000004476
ft:sourceType
Salesforce
FirstPublishedDate
2019-05-09T07:31:30Z
lastModifiedDate
2024-03-10T07:46:25Z
VersionNumber
6

Docker installation of JFrog’s CLI configuration will not be persisted until you persist it explicitly. For example, if you run this command:

 docker run -it docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog rt config

this output will not display any configuration details, as the config container is dead:

Artifactory server ID: art

Artifactory URL: http://<art-url>/artifactory

Access token (Leave blank for username and password/API key): 

User: admin

Password/API key: 

[Info] Encrypting password…

root@amith:/opt/artifactory-pro-5.4.6/bin# docker run -it docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog rt c show

Resolution

The default location for your Docker container in the JFrog CLI is /root/.jfrog. You can persist the config details for JFrog CLI by using the following Docker syntax:

docker run -it -v <mount location in your OS>:/root/.jfrog docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog rt c art –url="http://<ARTURL>:8081/artifactory" –apikey="AKCp5ccayRyZcjXFKKfrsHJfBQ5sGjg2ogkgK2WMftZkSaH6qFkfAnoXDanwX2mH3kYSiDZpH"

Here’s an example of how you might run this command: 

 docker run -it -v /Users/amith:/root/.jfrog docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog rt c art –url="http://amith-art:8081/artifactory" –apikey="AKCp5ccayRyZcjXFKKfrsHJfBQ5sGjg2ogkgK2WMftZkSaH6qFkfAnoXDanwX2mH3kYSiDZpH"

Thereafter, when you run the command below, you’ll be able to see your Artifactory config details:
 

docker run -it -v /Users/amithkm:/root/.jfrog docker.bintray.io/jfrog/jfrog-cli-go:latest jfrog rt c show 

Server ID: art

Url: "http://amith-art:8081/artifactory"/

API key: "AKCp5ccayRyZcjXFKKfrsHJfBQ5sGjg2ogkgK2WMftZkSaH6qFkfAnoXDanwX2mH3kYSiDZpH"

Default: true