This chapter will show you basic Docker tooling with NetBeans:
-
Pull/Build Docker images
-
Run/Start/Stop Docker containers
Note
|
NetBeans only supports configuring Docker Engine running using Docker Toolbox. This means that if you are running Docker for Mac or Docker for Windows then NetBeans cannot be used. |
In “Services” window, right-click on “Docker”, click on “Add Docker…”
Specify Docker Machine coordinates, click on “Test Connection” to validate the connection:
Note
|
No support for Docker for Mac/Windows, filed as #262398. |
Click on “Finish” to see:
Expand the connection to see “Images” and “Containers”.
Right-click on Docker node and select “Pull…”.
Type the image name to narrow down the search from Docker Store:
Click on “Pull” to pull the image.
Log is updated in the Output window:
This image is now shown in Services tab
Any existing images on the Docker Host will be shown here as well.
Select an image, right-click on it, and click on “Run…”.
This brings up a dialog that allows the options that can be configured for running the container. Some of them are:
-
Container name
-
Override the command
-
Keep STDIN open and allocate pseudo-TTY (
-it
on CLI) -
Publish ports on Docker host interface (
-P
or-p
indocker run
command)
Click on “Next>” to see the options to configure exposed ports. Click on “Add” to explicitly map host port “8091” to container port “8091”.
Click on “Finish” to run the container. “Services” window is updated as:
Log is shown in the “Output” window:
Right-click on the container, select “Show Log” to show the log generated by the container. The container can be paused and stopped from here as well.