Working with Docker Extensions
1. Installing Docker Extensions
| Step | Description | Details |
|---|---|---|
| 1 | Prerequisites | Ensure Docker Desktop is installed and running on your system. |
| 2 | Open Docker Desktop | Launch Docker Desktop from your applications or desktop shortcut. |
| 3 | Navigate to Extensions | Go to the Extensions tab in the Docker Desktop UI. |
| 4 | Search for Extension | Use the search bar to find the desired Docker extension (e.g., Portainer, Visual Studio Code). |
| 5 | Install Extension | Click the "Install" button next to the extension you want to add. |
| 6 | Confirm Installation | Review and confirm any permissions or configurations required during installation. |
Note: Docker Extensions are currently in beta and may not be available on all platforms.
Warning: Ensure that the Docker extension you are installing is from a trusted source to avoid security risks.
2. Listing Extensions
| Command | Description | Notes |
|---|---|---|
| docker extension ls | List all installed Docker extensions | Shows extension ID, name, version, and status |
| docker extension ls --format json | Output in JSON format | Useful for scripting and automation |
| docker extension ls --filter status=enabled | List only enabled extensions | Filter by extension status |
Example: Listing all Docker Extensions
$ docker extension ls
ID NAME VERSION STATUS
my-extension My Extension v1.0.0 enabled
another-extension Another Extension v2.1.0 disabled
Example: Listing only enabled extensions
$ docker extension ls --filter status=enabled
ID NAME VERSION STATUS
my-extension My Extension v1.0.0 enabled
3. Updating Extensions
| Extension | Current Version | Latest Version | Status |
|---|---|---|---|
| Docker Desktop | 4.28.0 |
4.29.1 |
NEW |
| Portainer | 2.19.4 |
2.20.0 |
DEPRECATED |
Note: Ensure Docker Desktop is running before updating extensions.
Warning: Updating extensions may cause compatibility issues with older Docker versions.
Update Process Summary
- Check for available updates via Docker Desktop UI or CLI.
- Run
docker extension update <extension-name>to update. - Restart Docker Desktop after updates for changes to take effect.
4. Removing Extensions
| Command | Description | Notes |
|---|---|---|
| docker extension remove <extension-name> | Uninstalls a Docker extension | Replace <extension-name> with the actual name of the extension |
Note: This command removes the extension and all its associated resources from your Docker Desktop environment.
5. Using Extensions in Docker Desktop
| Feature | Description | Availability |
|---|---|---|
| Extension Marketplace | Access to a curated collection of Docker Extensions for various tools and services. | NEW Docker Desktop 4.27+ |
| Installation | Install extensions directly from the Docker Desktop UI or CLI. | Docker Desktop 4.20+ |
| UI Integration | Extensions can integrate into Docker Desktop's UI for easy access. | Docker Desktop 4.20+ |
Note: Extensions must be signed and verified by Docker to ensure security.
Workflow: Using Extensions in Docker Desktop
- Open Docker Desktop.
- Navigate to the Extensions tab in the sidebar.
- Click "Marketplace" to browse available extensions.
- Select an extension and click "Install".
- Once installed, the extension appears in the sidebar or toolbar.
Comparison: Docker Desktop vs Extension Capabilities
- Docker Desktop: Provides core container orchestration and management.
- Extensions: Add functionality like UI tools, monitoring dashboards, or CLI enhancements.
6. Discovering Extensions Marketplace
Example: Accessing Docker Extensions Marketplace
# Open Docker Desktop
# Navigate to Extensions tab
# Click on "Marketplace" button
# Example CLI command to search extensions (if available)
docker extension search "my-extension"
| Marketplace Feature | Description | Availability |
|---|---|---|
| Search | Search for extensions by name or keyword | NEW Docker Desktop 4.27+ |
| Filter | Filter extensions by category, type, or platform | Docker Desktop 4.20+ |
| Install | One-click installation of extensions from marketplace | Docker Desktop 4.20+ |
| Reviews | User reviews and ratings for extensions | Docker Desktop 4.25+ |
| Version History | View changelogs and version details | Docker Desktop 4.26+ |
Note: The Docker Extensions Marketplace is integrated into Docker Desktop UI. Extensions can be discovered and installed directly from the Extensions tab.
Warning: Only official Docker extensions or verified third-party extensions should be installed to ensure security and compatibility.
Key Marketplace Features
- Search and filter capabilities
- Extension metadata display (description, author, version)
- Installation and update support
- User feedback integration (ratings, reviews)
- Version tracking and changelog access
7. Managing Extension Permissions
| Permission | Description | Scope | Status |
|---|---|---|---|
| docker:extension:read | Read access to extension metadata and configuration | Extension-level | NEW |
| docker:extension:write | Write access to extension configuration and settings | Extension-level | NEW |
| docker:extension:manage | Full management access including uninstalling extensions | Extension-level | NEW |
| docker:extension:install | Install new extensions from the registry | System-level | NEW |
Example: Setting Extension Permissions via CLI
docker extension install my-extension --permission docker:extension:read,docker:extension:write
Note: Permissions are defined at installation time and can be updated using the
docker extension update command.
8. Configuring Extension Settings
| Setting | Description | Default Value | Notes |
|---|---|---|---|
| extension.config.path | Path to the configuration file for the extension | /config/extension.json |
Must be a valid JSON file path |
| extension.enabled | Enables or disables the extension | false |
Set to true to activate the extension |
| extension.debug | Enables debug mode for the extension | false |
Useful for troubleshooting issues |
Note: Changes to extension settings may require a Docker Desktop restart to take effect.
9. Using Database Extensions
| Extension | Description | Supported Databases | Features |
|---|---|---|---|
| Docker Extension for MySQL | Provides a graphical interface to manage MySQL databases. | MySQL 8.0+ |
Database creation, user management, query execution |
| Docker Extension for PostgreSQL | Enables easy management of PostgreSQL instances. | PostgreSQL 13+ |
Schema browsing, query editor, backup/restore |
| Docker Extension for MongoDB | Allows interaction with MongoDB instances via a GUI. | MongoDB 4.4+ |
Collection management, document viewer, aggregation pipeline |
Example: Connecting to a MySQL Database via Extension
docker run -d --name mysql-db \
-e MYSQL_ROOT_PASSWORD=mypassword \
-e MYSQL_DATABASE=testdb \
-p 3306:3306 \
mysql:8.0
Example: Using PostgreSQL Extension to Create a Table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100) UNIQUE
);
Note: Extensions require Docker Desktop to be installed and running.
Warning: Ensure that database credentials are securely managed when using extensions.
10. Using Monitoring Extensions
| Extension | Description | Features | Support |
|---|---|---|---|
| Docker Desktop Monitoring | Provides real-time monitoring and insights for Docker containers and services. | Resource usage, Logs, Metrics |
Good |
| Prometheus Exporter | Exports metrics from Docker containers to Prometheus for monitoring and alerting. | Container metrics, Service metrics, Alerting |
Modern |
| Grafana Integration | Visualizes Docker container and service metrics in Grafana dashboards. | Dashboard creation, Custom queries, Alerts |
Good |
Example: Setting up Prometheus Exporter
version: '3'
services:
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
docker-exporter:
image: quay.io/prometheus/node-exporter
ports:
- "9100:9100"
Example: Grafana Dashboard Setup
{
"dashboard": {
"title": "Docker Container Metrics",
"panels": [
{
"title": "CPU Usage",
"type": "graph",
"targets": [
{
"expr": "rate(container_cpu_usage_seconds_total[5m])"
}
]
}
]
}
}
Note: Ensure that the Prometheus exporter is configured to scrape metrics from Docker containers using appropriate labels and service discovery.
11. Using Security Extensions
| Extension | Description | Security Focus | Installation |
|---|---|---|---|
| Docker Security Scanning | Scans images for vulnerabilities and provides remediation guidance. | Vulnerability scanning, compliance checks | Available via Docker Desktop UI or CLI |
| Trivy Extension | Open-source vulnerability scanner for containers and systems. | Image scanning, CVE detection | Installed via Docker Extensions marketplace |
| Aqua Security Extension | Provides runtime protection and compliance monitoring. | Runtime security, policy enforcement | Requires Aqua Enterprise license |
Example: Scanning an Image with Trivy
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image nginx:latest
Note: Ensure Docker Desktop is running to access extensions via UI.
Warning: Some security extensions require elevated permissions to scan system-level components.
12. Building Custom Extensions
Example: Basic Extension Structure
{
"name": "my-docker-extension",
"version": "1.0.0",
"description": "A custom Docker extension",
"icon": "icon.svg",
"ui": {
"dashboard": {
"path": "/dashboard"
}
},
"backend": {
"binary": "my-extension-binary"
}
}
| Field | Description | Required |
|---|---|---|
| name | Extension name, must be unique | Yes |
| version | Extension version, follows semantic versioning | Yes |
| description | Short description of the extension | No |
| icon | Path to SVG icon file | No |
| ui | UI configuration including dashboard path | No |
| backend | Backend binary or service configuration | No |
Note: The extension must be built for the target platform (Linux, macOS, Windows) and comply with Docker's extension SDK requirements.