-
NetBeans Nightly on Sep 15, 2016
-
No support for Docker for Mac, only Docker Machine supported
-
In
Services
tab, configure Docker Machine using URL -
Click on
Test Connection
to verify the connection -
Show the list of images and containers - running and non-running
-
Right-click on machine name, click on
Pull…
, search forarungupta/couchbase
image-
Show how images on Doker Hub can be seen here
-
-
Show output in
Output
window
-
Right-click on the downloaded image, select
Run…
, take the defaults-
Go to browser and show 192.68.99.100:8091 is not accessible (because ports were not exposed)
-
Stop and remove the container
-
-
Run the container again, click on
Next>
, click onAdd Exposed
, click onFinish
-
Show
192.168.99.100:8091
-
Right-click on machine name and cick on
Build…
-
Provide a directory where Dockerfile already exists and build the image
-
Provide the image name in
Repository
-
Open Dockerfile using
Files
to show syntax highlighting
-
-
Create a new Maven project
-
Add a new Dockerfile
-
Go to
Files
panel, right-click on Dockerfile and showBuild…
-
Tested with Neon.1 RC3 (at the time of this writing)
-
Make sure to download the complete bundle instead of just the installer
-
-
Help
,Install New Software
,Neon
update site, search forDocker Tooling
, finish the install-
Use http://download.eclipse.org/linuxtools/update-neon-1-docker-rc4/ for Neon.1 RC3
-
-
Switch to
Docker Tooling
perspective -
Explain connection dialog (show how defaults are populated)
-
Docker Machine
-
Use
docker-machine env
to print the environment -
Use
DOCKER_HOST
andDOCKER_CERT_PATH
for TCP Connection -
Click on Test Connection
-
-
Docker for Mac
-
Start Docker for Mac
-
Configure using
Unix socket
. Connection name ofmoby
and socket ofunix:///var/run/docker.sock
are automatically picked. -
Click on
Test Connection
-
-
-
Multiple views
-
Docker Explorer
- view for creating/managing connections to Docker daemons -
Docker Images
- view for managing Docker images -
Docker Containers
- view for managing Docker containers -
Docker Image Hierarchy
- image hierarchy for Docker images -
Console
- Display logs of stdout/stderr output from Containers and in some instances, allow input to stdin -
Properties
- Detailed information about connections, images and containers
-
-
Customize View
- show/hide stopped containers -
Preferences
,Docker
,Registry Accounts
-
Multiple accounts can be setup and used for pushing images to registry with authentication
-
-
Right-click on node, search for
arungupta/couchbase
image -
Show output in
Progress
window -
Properties of the image in
Properties
window
-
Right-click on the downloaded image, click on
Run
-
Explain port publishing, container linking (legacy),
-it
,--rm
, data volumes, environment variables, labels, CPU & memory limits
-
-
Unselect
Publish all exposed ports …
to map the ports to the same number on the host -
Show log in Console
-
Show
127.0.0.1:8091
-
Docker Containers
pane, show context-sensitive menu on top right. It changes if the container is stopped or running. -
Show All containers
-
Run configurations
-
Click on
Run
,Run Configurations
, walk through the configuration of containers
-
-
Select a container in
Docker Containers
, inProperties
, showInfo
andInspect
-
Docker Compose
-
Check out a project TODO
-
Select
docker-compose.yml
, right-clickRun As
→Docker Compose
-
-
In
Docker Images
view, click on hammer -
Provide an image name and directory name (will be created)
-
Use
Dockerfile
:FROM openjdk:8-alpine CMD ["/usr/bin/java", "-version"]
Dockerfile editor is a basic text editor with support for copy/paste but no syntax highlighting
-
Right-click on the image and select
Open Image Hierarchy
to show the hierarchy of images -
Right-click on the container and click on
Run
to run the image and see the output:2016-09-16T05:24:37.948910862Z openjdk version "1.8.0_92-internal" 2016-09-16T05:24:37.949566555Z OpenJDK Runtime Environment (build 1.8.0_92-internal-alpine-r1-b14) 2016-09-16T05:24:37.949876330Z OpenJDK 64-Bit Server VM (build 25.92-b14, mixed mode)
-
Click on
Run Configurations
, walk through the configuration inBuild Docker Image
andRun Docker image
.
-
Download IntelliJ IDEA Community or Ultimate
-
Tested with 2016.2
-
-
Install plugin
-
Preferences
,Plugins
,Install JetBrains plugin…
-
Search on
Docker
, click onInstall
-
Restart IntelliJ
-
-
Create a Java project
-
Create Deployment
-
Preferences
,Build, Execution & Deployment
,Clouds
-
Create a new deployment of type Docker
-
Use the defaults for Docker Machine
-
-
Docker Tooling window
-
Re-open the project
-
View
,Tool Windows
,Docker
-
Click on
Connect
or green arrow to connect to Docker Machine
-
-
Select top-level node
-
Click on
Pull image
-
Show how multiple registries can be configured
-
-
Type
arungupta/couchbase
and pull
-
Select an image, click on
Create container
-
Select
After launch
and enter the URL ashttp://192.168.99.100:8091
-
Go to
Container
tab, addPort bindings
for8091:8091
-
Right-click on the running container and explain the menu items. Show
Inspect
-
Show how to Stop and Delete container from the left menu
-
Refer to the instructions https://www.jetbrains.com/help/idea/2016.2/docker.html
-
Right-click on the project, create a new directory
docker-dir
-
Create Artifact
-
Click on top-right for
Project Structure
-
Select
Artifacts
-
Change
Type:
toWeb Application: Archive
-
Change the name to
helloweb
-
Change
Output directory
todocker-dir
-
Click on
OK
-
-
Create
Dockerfile
in this directory. Use the contentsFROM jboss/wildfly ADD helloweb.war /opt/jboss/wildfly/standalone/deployments/
-
Run
,Edit Configurations
, add newDocker Deployment
-
Change name to
helloweb
-
Deployment
tab-
Select
After launch
, change the URL tohttp://192.168.99.100:18080/helloweb/index.jsp
-
In
Before launch
, addBuild Artifacts
and select the artifact
-
-
Container
tab-
Add
Port bindings
for8080:8080
-
-
-
View
,Tool Windows
,Docker
, connect to it -
Run the project
-
Preferences
,Build, Execution, Deployment
,Clouds
, set the path ofdocker-compose
to/usr/local/bin/docker-compose
. -
Create a
docker-compose.yml
indocker-dir
-
Copy Compose file from https://github.com/arun-gupta/oreilly-docker-book/blob/master/hello-javaee/docker-compose.yml
-
Create new deployment, select
docker-dir/docker-compose.yml
inDeployment:
-
Run the project and show the running containers under
Compose