# Technology Tip #2 – Use dive as a tool for optimizing Docker or OCI image

> Use dive as a tool for optimizing and exploring a Docker image, layer contents, and discovering ways to shrink the size of your Docker or OCI image

### Installation Instructions on Mac Machine

-   Install using brew:

```
brew install dive
```

### **Examples of running dive for optimizing Docker images**

-   Running dive as part of CI pipeline with arguments to fail/pass the build. For example, the below will fail the build if wasted bytes is more than 1024 bytes:

```
dive --ci --highestWastedBytes 1024 30a68f3b058e
```

![using dive as a tool for optimizing Docker/OCI image](https://vedcraft.com/images/2021/10/diveExample-1024x703.jpg)

Figure A – Example of using dive for optimizing Docker/OCI image

-   Other **key features** of the tool are:
    -   Ability to show Docker image content by each layer
    -   Ability to indicate change in each layer
    -   Ability to estimate Docker image efficiency
    -   Ability to integrate with continous integration (CI) tool
    -   Ability to inspect multiple images sources and container engines

This technology tip to use dive as a tool for optimizing Docker or OCI image can be used not only for build time but also for runtime integration with CI (continuous integration) tool as a build quality parameter.

**References**

-   [dive GitHub Repository](https://github.com/wagoodman/dive)

* * *

## Read blogs on our website for various focus areas

-   [Software Architecture and Design Patterns](https://vedcraft.com/architecture/)
-   [Emerging Technology Patterns & Trends](https://vedcraft.com/tech-trends/)
-   [Technology Learnings and Knowledge Sharing](https://vedcraft.com/learning-paths/)

![](https://vedcraft.com/images/2015/09/elearn.jpg)

## Software Architecture and Design Patterns

## Emerging Technology Patterns & Trends

## Technology Learnings and Knowledge Sharing
