Search code examples
jfrog-xray

xray newbie- first docker scan from cli


I'm starting with JFrog Xray. I created an account on JFrog cloud platform using my Github credentials. I created an identity token for authentication.

I have a linux box with only terminal (No GUI). In that I downloaded a project from Github and built a docker image from the source code. Now I can see the images using command sudo docker images.

Now I installed the JFrog CLI using command

curl -fL https://getcli.jfrog.io\?setup | sh 

The cli gets installed but as there is no browser, the integration with cloud does not happen.

Now I run the docker scan using the command

sudo jf docker scan <image-name> --url <url> --access-token <access-token>

The error I receive is as below

Get "api/v1/system/version": unsupported protocol scheme ""

Any help/ guidance is sincerely appreciated.

Thanks


Solution

  • The curl -fL https://getcli.jfrog.io?setup | sh command installs JFrog CLI and then initiates the jf setup command. The jf setup command does the following:

    1. Opens the default browser, and allows you to sign in to a new and free JFrog environment in the cloud.
    2. Configures JFrog CLI with the new JFrog instance connection details.

    Since your Linux box includes no browser, I assume step #1 fails.

    No worries though - Since the set up of a free JFrog environment requires a browser, here's what you can do to set up an environment and use it on your Linux box:

    1. Set up the free JFrog environment in the cloud from a different machine with a browser installed, using this page - https://jfrog.com/start-free/#saas
    2. Log into your new environment UI
    3. Go to "Integrations" on the left menu panel
    4. Copy the "JFrog CLI" installation command, and run it from your Linux box

    This should get JFrog CLI installed and set up with your new JFrog environment.