简体   繁体   中英

Finding dependencies of a docker image

I have a docker image and I want to be able to find out how to find out all the dependencies that are being pulled from the internet. I tried looking for an open source program to do this for me but I could not find anything that seems suitable. I am now trying to write my own app in python. Does anyone know where to start?

This is a section of my dockerfile

RUN wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz && \
    wget -q https://www.apache.org/dist/zookeeper/KEYS && \
    wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc && \
    wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.sha256
  1. The https://github.com/wagoodman/dive tool might help you go through previous layers and see what files are in the image.
  2. docker history --no-trunc <yourimage> will show you what commands were run to build the image.

The combination should let you know what you need.

If those dependencies aren't documented then it's anyone's guess. This is just source and there's never been a requirement to produce a dependency list in machine readable form.

Usually you check the README.md or INSTALL.txt and hope that explains.

Since you're using Docker, why not look for a Dockerized version of Zookeeper? There's an official image which is usually good to go on its own, or you can always look at how that was created by looking through the Dockerfile for that build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM