Upcoming Docker Tooling for Eclipse gave a preview of Docker Tooling coming in Eclipse. This Tech Tip will show how to get started with it.

docker-logoeclipse-logo

NOTE: This is pretty bleeding edge and so some of the features may be half baked. But we are looking for all the feedback we can get!

The Docker tooling is aimed at providing at minimum the same basic level features as the command-line interface, but also provides some advantages by having access to a full fledged UI.

Install Docker Tools Plugins

Docker Explorer

The Docker Explorer provides a wizard to establish a new connection to a Docker daemon. This wizard can detect default settings if the user’s machine runs Docker natively (such as in Linux) or in a VM using Boot2Docker (such as in Mac or Windows). Both Unix sockets on Linux machines and the REST API on other OSes are detected and supported. The wizard also allows remote connections using custom settings.

  • Use the menu Window, Show View, Other…. Type “docker” to see the output as:jbds-docker-tools-docker-view
  • Select Docker Explorer to open the explorer.Docker Eclipse Tools
  • Click on the link in this window to create a connection to Docker Host. Specify the settings as shown:jbds-docker-tools2-1024x688Make sure to get IP address of the Docker Host using `docker-machine ip` command.Also, make sure to specify the correct directory for `.docker` on your machine.
  • Click on Test Connection to check the connection. This should show the output as:jbds-docker-tools-test-connection-output-1024x518 (1)Click on OK and Finish to exit out of the wizard.
  • Docker Explorer itself is a tree view that handles multiple connections and provides users with quick overview of the existing images and containers.jbds-docker-tools3-1024x371
  • Customize the view by clicking on the arrow in toolbar:jbds-docker-tools-customize-view-option-1024x305
  • Built-in filters can show/hide intermediate and dangling images, as well as stopped containers.Docker Eclipse Tools

Docker Images

The Docker Images view lists all images in the Docker host selected in the Docker Explorer view. This view allows user to manage images, including:

  • Pull/push images from/to the Docker Hub Registry (other registries will be supported as well, #469306)
  • Build images from a Dockerfile
  • Create a container from an image

Let’s take a look at it.

  • Use the menu  Window, Show View, Other…, select Docker Images. It shows the list of images on Docker Host:jbds-docker-tools4-1024x348
  • Right-click on the image ending with wildfly:latest and click on the green arrow in the toolbar. This will show the following wizard:Docker Eclipse Tools
  • By default, all exports ports from the image are mapped to random ports on the host interface. This setting can be changed by unselecting the first checkbox and specify exact port mapping.Click on Finish to start the container.
  • When the container is started, all logs are streamed into Eclipse Console:

jbds-docker-tools5-1024x366Docker Containers

Docker Containers view lets the user manage the containers. The view toolbar provides commands to start, stop, pause, unpause, display the logs and kill containers.

  • Use the menu Window, Show View, Other…, select Docker Containers. It shows the list of running containers on Docker Host:jbds-docker-tools6-1024x262
  • Pause the container by clicking on the pause button in the toolbar (#469310). Show the complete list of containers by clicking on the View Menu, Show all containers.jbds-docker-tools-all-containers-1024x279
  • Select the paused container, and click on the green arrow in the toolbar to restart the container.
  • Right-click on any running container and select Display Log to view the log for this container.Docker Eclipse Tools

Information and Inspect on Images and Containers

Eclipse Properties view is used to provide more information about the containers and images.

  • Just open the Properties View and click on a Connection, Container, or Image in any of the Docker Explorer View, Docker Containers View, or Docker Images View. This will fill in data in the Properties view.
  • Info view is shown as:Docker Eclipse Tools
  • Inspect view is shown as:Docker Eclipse Tools

The code is hosted in Linux Tools project.

File your bugs at: bugs.eclipse.org/bugs/enter_bug.cgi?product=Linux%20Tools and use “Docker” component. Talk to us on IRC.

Enjoy!

Getting Started with Docker Tools in Eclipse

Profile photo of Arun Gupta
About The Author
- Arun Gupta is the vice president of developer advocacy at Couchbase. He has been building developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of a best-selling book, an avid runner, a globe trotter, a Java Champion, and a JUG leader, he is easily accessible at @arungupta.

3 Comments

  • Renato Perini
    Reply

    How cool is that? Always dreamed of a docker tooling set integrated with Eclipse. Thank you guys. This will be awesome

  • Sonyfe25cp
    Reply

    Hi, this article is really helpful for beginners to learn how to use Docker Tools.
    However, there are several images can’t shown in our network.
    Could you check them ?
    Broken images are as follows:
    1. image below the item ‘Select Docker Explorer to open the explorer.’
    2. image below the item “Built-in filters can show/hide intermediate and dangling images, as well as stopped containers”
    3. image below the item “Right-click on the image ending with wildfly:latest and click on the green arrow in the toolbar.”
    4. image below the item “Right-click on the image ending with wildfly:latest and click on the green arrow in the toolbar”
    5. image below the item “Right-click on any running container and select Display Log to view the log for this container.”
    6. image below the item “Info view is shown as:”
    7. image below the item “Inspect view is shown as:”

    Once you fix these images, please send me a email.
    Thank you!

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>