Select Page

Docker Desktop Extensions Every Developer Must Try

Pavan Belagatti
Published: November 10, 2022

The world of software development is changing faster than ever. The need for faster release cycle times has led to a proliferation of virtualization technologies. Virtual machines (VMs) have been around for many years, but containers have recently overshadowed them because VMs are slower and not as lightweight as containers. With the popularity of microservices, containers have emerged as an excellent alternative to virtual machines for developing, testing, and deploying applications in a lightweight environment. 

There comes Docker, an open-source technology that uses Linux containers to virtualize apps and other software processes so they can run independently and more securely in another container as if they were separate computer programs on the same device.

Docker packages software applications in virtual containers so they can be shipped, deployed, and run quickly and efficiently. These containers are like virtual lockers for your application. They package your application and its dependencies so it can be shipped and run anywhere transparently. That means you can have the same user experience from your development, testing, staging, or production systems.  

Docker Extensions

Docker announced Docker extensions at DockerCon 2022. The idea of Docker extensions is to help developers expand their capabilities by using third-party tools, just like plugins. You can enable the extensions available from the extensions tab on the Docker desktop with a single click. The extensions improve developer productivity and smoothen the workflows. Developers can use their favorite tools from a centralized place, i.e. Docker desktop. 

Before exploring the various interesting extensions, go to your Docker desktop and enable extensions from the preferences.

Docker Extensions

Today, we will see some must-have Docker extensions for developers to speed up their software development. 

DroneCI

We all know that continuous integration (CI) is the first official step to doing DevOps. When developers write the code, they store it in a source control management tool like Git. Then, they test and build the code with the help of a continuous integration tool. CI is an essential part of every DevOps approach. DroneCI is an open-source CI tool that is very easy to set up and use. Now that we have this as an extension, you will be able to do CI from your laptop. You just need a yml file to define your steps, and you are done. 

Let us have a simple Node.js application to work with our plugins. Clone the sample application.

kind: pipeline
type: docker
name: default
 
platform:
 os: linux
 arch: arm64
 
steps:
- name: message
  image: busybox
  commands:
  - echo “Hello Captain Canary”!
 
- name: test
  image: node
  commands:
  - npm install
  - npm test

You can directly install the Drone CI extension from the Docker desktop extensions tab.

Extensions Marketplace

Once installed, click on the Drone CI extension and you will be presented with the below dashboard:

Drone Pipelines

As we have not configured any pipelines yet, you should see a blank dashboard with no pipelines imported.

Click on ‘Import Pipelines’ to import your project. The extension will show you all the projects that have the .drone.yml in them. So, import a project to try from your local.

To show you an example, I imported my Simple-Node-App project, which is a simple node.js application that includes simple tests.

Import Pipelines

The next step is to run the pipeline, and for this, we need to add some simple settings that we will be doing once we click on the run/play button; you see the below actions:

Run Pipeline

Add the required fields such as steps to run, a secret file if you have one (which you can specify in a secret.txt file), an environment file, etc. 

Run

Once you run your application, you will see the pipeline getting executed. 

Executed Pipeline

vcluster

Working with Kubernetes can be highly overwhelming. As it involves a vast learning curve, developers spend more time and effort understanding this platform. It is all worth it, but what if there are tools that aid developers and help them increase productivity? 

vclusters is one such tool with which you can create virtual clusters on top of any Kubernetes cluster. Instead of creating full-blown clusters that might just shoot up your cloud bill, the vclusters are cheap, with the added advantages of multi-tenancy. This will benefit anyone required to set up different development and testing configurations. 

Make sure to enable Kubernetes from the Docker desktop preferences.

Kubernetes

The vcluster extension is readily available on the Docker desktop extensions tab and can be installed with a click. 

Extensions Marketplace

Once the extension is installed, you will see a simple dashboard to create the virtual cluster.

New vcluster

You can then click on ‘Create new cluster.’ Name your cluster, fill in the required fields, and click on ‘Create.’ 

Create New vcluster

Once you fill in all the required fields, you should be able to see your cluster getting created. After some time, you should see it running. 

Created vcluster

You can verify the running cluster using vcluster CLI. The command to list your vclusters is: 

vcluster list

Microcks

Microcks is an open-source platform to mock and test APIs and microservices. You can deploy mocks and experiment with your rest APIs locally. Now that the Docker extension is available, you can efficiently mock and test event-based APIs. Microcks extension is readily available on the Docker desktop and can be easily installed with a click.

Microcks

Click on the ‘Launch Microcks’ tab:

Launch Microcks

Running Microcks

The Microcks starts running, and you can access the localhost:8080 to test your APIs.

Let’s go to localhost:8080, and you should see the Microcks dashboard.

Mickrocks Dashboard

Click on the ‘APIs’ and ‘Services’ tabs:

Add Direct API

Choose ‘REST API’ and click ‘Next.’

Add a New Direct API

Name the API, Version and Resource and click ‘Next.’

Click Next

Add the dummy JSON Reference Payload as shown below for this experiment and click ‘Next.’

API Reference Source

The last step is to Review, and once the data added by you is correct, click ‘Next.’ 

Review

You should see your just-created API listed.

API's and Services

Click on it to see the CRUD operations listed with endpoints. Let’s test with Get.

CRUD Operations

Copy the link and open the endpoint on a local browser and you should see something like this:

Local Host

Conclusion

Docker is a must-know platform for anybody working with software development. Over the years, Docker has built a vast community and support. This is an excellent initiative by Docker to help developers to streamline their work around software development and deployment. The exciting fact is you can build your own custom-made extension. We have several extensions on and off the extensions marketplace. From continuous integration to delivery, we have all the extensions we need. The above-listed extensions can significantly impact your software delivery pipeline when used wisely. Please try them and increase your speed and productivity.

Source: dzone.com