DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Low-Code Development: Leverage low and no code to streamline your workflow so that you can focus on higher priorities.

DZone Security Research: Tell us your top security strategies in 2024, influence our research, and enter for a chance to win $!

Launch your software development career: Dive head first into the SDLC and learn how to build high-quality software and teams.

Open Source Migration Practices and Patterns: Explore key traits of migrating open-source software and its impact on software development.

Related

  • How To Use the Node Docker Official Image
  • Using Environment Variable With Angular
  • Docker Commands Beginners Should Know
  • How to Integrate a Distributed Database With Event Streaming

Trending

  • Mastering Distributed Caching on AWS: Strategies, Services, and Best Practices
  • Data Integration Technology Maturity Curve 2024-2030
  • Agile vs. DevOps: What Sets Them Apart?
  • Addressing Memory Issues and Optimizing Code for Efficiency: Glide Case
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Docker Images Tree Visualization

Docker Images Tree Visualization

See how you can still get a hierarchy tree visualization of the images in your container after the most recent Docker release.

By 
Peter Pilgrim user avatar
Peter Pilgrim
·
Aug. 08, 17 · Tutorial
Like (5)
Save
Tweet
Share
19.1K Views

Join the DZone community and get the full member experience.

Join For Free

In the recent Docker release, you might be surprised that the tree view no longer works as expected:

 $ docker images --tree 

The above command would produce a visual dump of the images inside the container. The command generated a hierarchy of the images, showing the relationship between parent and children. However, this command has been dropped since Docker version 1.6. So what do you do?

You can use the custom document plugin images, DockViz from JustOne of Github.

The simplest way is to start up the Docker image and log in as a Bash user. Upgrade yourself to root superuser and then launch the following command:

 $ alias dockviz="docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz" 

Now execute the alias:

 $ docker dataviz -t 

This command downloads the DockViz image then executes Docker API using the protocol, obviously over the named UNIX socket. The result is a hierarchy tree of the images in your container, very similarly to “docker images -t.”

If you have trouble getting access to /var/run/docker.sock even as “root” superuser. Try the following by adding the –privileged flag to the alias command. Run the following command:

 $ alias dockviz="docker run -it --privileged --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz" 

My final tip is add the “alias” to the login script for the superuser. Here is the command for that:

 $ echo 'alias dockviz="docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz"' > ~/.bash_profile 

This is because RHEL, CentOS and SE Linux restrict access to the docker socket even for superusers. Channeling “SECURITAH!” @SwiftOfSecurity ��

Docker (software) Tree (data structure) Command (computing) Visualization (graphics)

Published at DZone with permission of Peter Pilgrim, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How To Use the Node Docker Official Image
  • Using Environment Variable With Angular
  • Docker Commands Beginners Should Know
  • How to Integrate a Distributed Database With Event Streaming

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: