Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to give docker pull command to scan docker image #174

Closed
sameer1046 opened this issue May 7, 2021 · 5 comments
Closed

Support to give docker pull command to scan docker image #174

sameer1046 opened this issue May 7, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@sameer1046
Copy link

sameer1046 commented May 7, 2021

Currently it only support upload tar file.
The user should give the docker image name and tag while creating project and the tool should pull the image from backend if docker is already installed in the machine.

@tdruez
Copy link
Contributor

tdruez commented May 7, 2021

@sameer1046 Good idea, PR welcome :)

@pombredanne pombredanne added the enhancement New feature or request label May 7, 2021
@pombredanne
Copy link
Member

pombredanne commented May 7, 2021

@sameer1046 @tdruez actually there should have been a ticket for this and as it happens I am working on this.

This is going to be based in part on this https://github.com/nexB/container-inspector/blob/main/src/container_inspector/fetch/docker_image.py and https://github.com/containers/skopeo and the input will a docker:// URL and it will not require to have docker installed locally nor to have root privileges. I thought I had a ticket for this, but this is only mentioned here aboutcode-org/fetchcode#41

So I will use your ticket for tracking then.

Your use case would be for the server-side locally pulled Docker images? Can you elaborate a bit more?

tdruez added a commit that referenced this issue May 11, 2021
…ine API #174

Signed-off-by: Thomas Druez <tdruez@nexb.com>
pombredanne added a commit to aboutcode-org/scancode-plugins that referenced this issue May 11, 2021
aboutcode-org/scancode.io#174

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue May 11, 2021
This adds a new way to fetch docker images using skopeo provided as a
plugin using docker:// reference URL-like pointers to a docker image.
The syntax is docker://<docker image> where <docker image> is the string
that would be used in a "docker pull <docker image>" command.

Also rename scanpipe.pipes.fetch.download() to fetch_http()

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
tdruez added a commit that referenced this issue May 11, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
pombredanne added a commit that referenced this issue May 11, 2021
Both in the Dockerfile and in the documentation

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
tdruez added a commit that referenced this issue May 12, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
pombredanne added a commit that referenced this issue May 12, 2021
This queries the regsitry to get the first os/arch and variant if any
This allows to fetch images for other os/arches than the one where
we are running, including windows for #163

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
tdruez added a commit that referenced this issue May 12, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
pombredanne added a commit that referenced this issue May 12, 2021
@pombredanne
Copy link
Member

@sameer1046 this is now part of the latest release https://github.com/nexB/scancode.io/releases/tag/v21.5.12 if you can try it.
Basically you can input a URL in this style: docker://debian:buster-slim like below. Just take anything you would docker pull xxx and use docker://xxx instead.

Screenshot from 2021-05-12 23-23-56

@sameer1046
Copy link
Author

NICE!!!

@sameer1046
Copy link
Author

Feature Implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants