Answers: <p>I can answer half of your question: If you have a set of images you're trying to investigate, the best way would be to use <code>which</code> in a new container using the image in question. This way you can quickly see if a particular image has the binaries your are looking for already on <code>PATH</code>:</p>
  
  <pre><code>docker run --rm ubuntu:latest which zip git
  # no result
  
  docker run --rm ubuntu:latest which bash sh
  /bin/bash
  /bin/sh
  # ^-- both bash and sh are in the image
  </code></pre>
  
  <p>I don't know of a way to discover the set of images in question, as there is no manifest of files that a registry will provide. That is, yes, an image is a set of tar files, which you can extract a set of files/directory names... however, you'd still need to pull the entire image to get this information, so it would be easier to run the <code>which</code> command above.</p>
  
  <p>There are tools for exploring information that a registry exposes (skopeo, doocker-ls, reg, manifest-tool, etc) but none of them will do exactly what you're looking for, which is "find a repository within a registry which contains an image that has a particular binary in it". </p>
  
Answers: CC BY-SA 4.0
Answers: 2020-02-10T12:29:04.483Z
Answers: Thanks for the answer. I did some research as well and came to the same conclusion - that there are tools that can look into images and even extract separate layers. With the tool that can extract the merged image cake building a searchable index for top 100 images will not be hard, but for now there is no solution.
Answers: Anatoli Babenia
Answers: CC BY-SA 4.0
Answers: 2020-02-10T02:28:10.680Z
Answers: 2020-02-10T02:28:10.680Z
Answers: wagoodman
Answers: <p>There are several options:</p>
  
  <ul>
  <li>The first one is like you mentioned, creating an image yourself, push it to dockerhub and run <code>docker run yourimage git</code> etc.</li>
  <li><p>Another option is to use an image that has already been published like <a href="https://hub.docker.com/r/dockerinpractice/docker-dev-tools-image/dockerfile" rel="nofollow noreferrer">this one</a>. One could run it by issuing:</p>
  
  <pre><code>docker run dockerinpractice/docker-dev-tools-image git
  </code></pre></li>
  <li><p>A third option is to add git to an existing image by using a Dockerfile:</p>
  
  <pre><code>FROM alpine/git:1.0.7
  
  RUN apk add --update zip
  </code></pre></li>
  </ul>
  
  <p>Personally I wonder whether docker is the right tool for the job in this case.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-12-22T16:25:00.167Z
Answers: Still no answer how to find images like `dockerinpractice/docker-dev-tools-image`. This one is 4 years old and might have security issues.
Answers: Anatoli Babenia
Answers: CC BY-SA 4.0
Answers: 2019-12-22T13:42:41.163Z
Answers: 2019-12-22T13:42:41.163Z
Answers: 030
Answers: <p>If you have don't want to push your images to docker.com, are on an isolated network, or if you are doing this kind of thing regularly, you could consider setting up your own local docker registry.  Doing this would </p>
  
  <p>Setting up a docker registry is not a trivial task, you can find detailed instructions for setting up a docker registry at <a href="https://docs.docker.com/registry/deploying/" rel="nofollow noreferrer">docker.com</a>, but here is a brief summary:</p>
  
  <ol>
  <li><p>Get/run the docker registry image (yes, the registry will run inside docker):</p>
  
  <p><code>docker run -d -p 5000:5000 --restart=always --name registry registry:2</code></p></li>
  <li><p>build your image or use an existing one:</p>
  
  <p><code>docker tag ubuntu:16.04 localhost:5000/my-ubuntu</code></p></li>
  <li><p>Push this image to your logcal registry:</p>
  
  <p><code>docker push localhost:5000/my-ubuntu</code></p></li>
  </ol>
  
  <p>Once you do this, you will be able to treat this local registry like Docker Hub; you could delete your "local" copy of this ubuntu image, then pull it down from your local repository again:</p>
  
  <pre><code>docker image remove ubuntu:16.04
  docker image remove localhost:5000/my-ubuntu
  docker pull localhost:5000/my-ubuntu
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-12-25T11:12:14.003Z
Answers: Do you know if I can index files inside these Docker images?
Answers: Anatoli Babenia
Answers: CC BY-SA 4.0
Answers: 2019-12-24T12:36:52.347Z
Answers: 2019-12-24T12:36:52.347Z
Answers: kevlarjacket
Body: <p>To speed up builds, I'd like to avoid install tools that I need on every commit with <code>apt-get update -y &amp;&amp; apt-get install -y git zip</code>.</p>
  
  <p>Normal way is to create custom build image, register at Docker Hub and upload it there. But I am 100% sure that there is already an up to date image that contains both <code>git</code> and <code>zip</code> tools that I need. The only question is how to find this image?</p>
  
  <p><strong>UPDATE 202004</strong>: There is no indexer for DockerHub, and there is no even indexer for Docker image contents. To start with that one could get a list of files from an image by patching <a href="https://github.com/wagoodman/dive" rel="nofollow noreferrer"><code>dive</code></a> by @wagoodman, or using <a href="https://github.com/GoogleContainerTools/container-diff" rel="nofollow noreferrer">https://github.com/GoogleContainerTools/container-diff</a></p>
  
Tags: <docker><dockerhub>
Title: Find most popular images with `zip` and `git` on Docker Hub
UserDisplayName: Anatoli Babenia
ThreadText: # Find most popular images with `zip` and `git` on Docker Hub
  
  (Asked by: username_0 on 2019-12-21)
  
  To speed up builds, I'd like to avoid install tools that I need on every commit with `apt-get update -y && apt-get install -y git zip`.
  
  Normal way is to create custom build image, register at Docker Hub and upload it there. But I am 100% sure that there is already an up to date image that contains both `git` and `zip` tools that I need. The only question is how to find this image?
  
  **UPDATE 202004**: There is no indexer for DockerHub, and there is no even indexer for Docker image contents. To start with that one could get a list of files from an image by patching [`dive`](https://github.com/username_1/dive) by @username_1, or using <https://github.com/GoogleContainerTools/container-diff>
  
  **Tags:** docker, dockerhub
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2020-02-10. Score: 2 | Accepted answer
  
  I can answer half of your question: If you have a set of images you're trying to investigate, the best way would be to use `which` in a new container using the image in question. This way you can quickly see if a particular image has the binaries your are looking for already on `PATH`:
  
  ```
  docker run --rm ubuntu:latest which zip git
  # no result
  
  docker run --rm ubuntu:latest which bash sh
  /bin/bash
  /bin/sh
  # ^-- both bash and sh are in the image
  
  ```
  
  I don't know of a way to discover the set of images in question, as there is no manifest of files that a registry will provide. That is, yes, an image is a set of tar files, which you can extract a set of files/directory names... however, you'd still need to pull the entire image to get this information, so it would be easier to run the `which` command above.
  
  There are tools for exploring information that a registry exposes (skopeo, doocker-ls, reg, manifest-tool, etc) but none of them will do exactly what you're looking for, which is "find a repository within a registry which contains an image that has a particular binary in it".
  
  > **Comments:**
  > **username_0**: Thanks for the answer. I did some research as well and came to the same conclusion - that there are tools that can look into images and even extract separate layers. With the tool that can extract the merged image cake building a searchable index for top 100 images will not be hard, but for now there is no solution.  
  
  ---
  
  ### Answer by username_2 on 2019-12-22. Score: 0
  
  There are several options:
  
  * The first one is like you mentioned, creating an image yourself, push it to dockerhub and run `docker run yourimage git` etc.
  * Another option is to use an image that has already been published like [this one](https://hub.docker.com/r/dockerinpractice/docker-dev-tools-image/dockerfile). One could run it by issuing:
  
    ```
    docker run dockerinpractice/docker-dev-tools-image git
  
    ```
  * A third option is to add git to an existing image by using a Dockerfile:
  
    ```
    FROM alpine/git:1.0.7
  
    RUN apk add --update zip
  
    ```
  
  Personally I wonder whether docker is the right tool for the job in this case.
  
  > **Comments:**
  > **username_0**: Still no answer how to find images like `dockerinpractice/docker-dev-tools-image`. This one is 4 years old and might have security issues.  
  
  ---
  
  ### Answer by username_3 on 2019-12-24. Score: 0
  
  If you have don't want to push your images to docker.com, are on an isolated network, or if you are doing this kind of thing regularly, you could consider setting up your own local docker registry. Doing this would
  
  Setting up a docker registry is not a trivial task, you can find detailed instructions for setting up a docker registry at [docker.com](https://docs.docker.com/registry/deploying/), but here is a brief summary:
  
  1. Get/run the docker registry image (yes, the registry will run inside docker):
  
     `docker run -d -p 5000:5000 --restart=always --name registry registry:2`
  2. build your image or use an existing one:
  
     `docker tag ubuntu:16.04 localhost:5000/my-ubuntu`
  3. Push this image to your logcal registry:
  
     `docker push localhost:5000/my-ubuntu`
  
  Once you do this, you will be able to treat this local registry like Docker Hub; you could delete your "local" copy of this ubuntu image, then pull it down from your local repository again:
  
  ```
  docker image remove ubuntu:16.04
  docker image remove localhost:5000/my-ubuntu
  docker pull localhost:5000/my-ubuntu
  
  ```
  
  > **Comments:**
  > **username_0**: Do you know if I can index files inside these Docker images?  
  
  ---
  
  