This Article will provide details about Docker security . How we can detect security vulnerabilities before it going into production . Automated way by integrating security vulnerabilities tool in pipeline and details about how we can fix security vulnerabilities by modifying Dockerfiles .
Why Docker security is more important ?
Vulnerable OS and non-OS packages and ensure that non-secure and non-compliant images are not promoted in trust production registries .
1. How to Install and Set Up Anchore CLI on Ubuntu 22.04
2. How to Install and Set Up Anchore Engine with Docker Compose
- Start Anchore Engine Services:
docker-compose up -d
![](https://devopslover.com/wp-content/uploads/2024/05/image-3-1024x385.png)
With this command, you can start all the services of Anchore Engine in the background.
- Check Services Status:
docker-compose ps
![](https://devopslover.com/wp-content/uploads/2024/05/image-4-1024x331.png)
With this command, you can check the status of all services of the Anchore Engine.
- Check Anchore Engine System Status:
docker-compose exec api anchore-cli system status
![](https://devopslover.com/wp-content/uploads/2024/05/image-5-1024x331.png)
With this command, you can check the system status of the Anchore Engine.
- Access Anchore Engine UI:
To access the Anchore Engine UI, you can open the URL http://localhost:8228/ in your browser.
http://localhost:8228/v1
![](https://devopslover.com/wp-content/uploads/2024/05/image-6-1024x287.png)
5. Stop Anchore Engine Services:
docker-compose down
![](https://devopslover.com/wp-content/uploads/2024/05/image-7-1024x370.png)
With this command, you can stop the Anchore Engine services.
# Check Anchore API endpoint using curl (replace your ip address)
curl http://192.168.170.251:8228/v1
# Check Anchore Engine status using anchore-cli with specified URL, username, and password (replace your ip address)
anchore-cli --u admin --p foobar --url http://192.168.170.251:8228/v1 system status
# Set environment variables for Anchore CLI (replace your ip address)
export ANCHORE_CLI_URL=http://192.168.170.251:8228/v1
export ANCHORE_CLI_USER=admin
export ANCHORE_CLI_PASS=foobar
![](https://devopslover.com/wp-content/uploads/2024/05/image-8-1024x401.png)
How to use this anchore engine
- Add Image: Add a Docker image to Anchore Engine for analysis.
anchore-cli image add nginx
![](https://devopslover.com/wp-content/uploads/2024/05/image-9-1024x401.png)
- List Images: List all Docker images currently known to Anchore Engine.
anchore-cli image list
![](https://devopslover.com/wp-content/uploads/2024/05/image-10-1024x134.png)
- Get Image Summary: Retrieve a summary of information about a specific Docker image.
anchore-cli image get nginx
![](https://devopslover.com/wp-content/uploads/2024/05/image-11-1024x354.png)
- Get Image Vulnerabilities: Retrieve vulnerability information for a specific Docker image.
anchore-cli image vuln nginx
![](https://devopslover.com/wp-content/uploads/2024/05/image-12-1024x152.png)
- Get Image Policy Evaluation: Retrieve policy evaluation results for a specific Docker image.
anchore-cli image get nginx
![](https://devopslover.com/wp-content/uploads/2024/05/image-14.png)
- Get Image Content: Retrieve detailed content information for a specific Docker image.
anchore-cli image content nginx
![](https://devopslover.com/wp-content/uploads/2024/05/image-13.png)
- Delete Image: Delete a specific Docker image from Anchore Engine.
anchore-cli image delete nginx
- Sending slack notification via pipeline job - August 25, 2024
- SonarQube integration with Jenkins - August 24, 2024
- Deployment of 2 application java and python using k8s : slack alerting Using Jenkins pipeline liberary - August 10, 2024