-
NetBeans Nightly on Sep 15, 2016
-
No support for Docker for Mac, only Docker Machine supported
-
In
Servicestab, configure Docker Machine using URL -
Click on
Test Connectionto verify the connection -
Show the list of images and containers - running and non-running
-
Right-click on machine name, click on
Pull…, search forarungupta/couchbaseimage-
Show how images on Doker Hub can be seen here
-
-
Show output in
Outputwindow
-
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
Filesto show syntax highlighting
-
-
Create a new Maven project
-
Add a new Dockerfile
-
Go to
Filespanel, 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,Neonupdate 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 Toolingperspective -
Explain connection dialog (show how defaults are populated)
-
Docker Machine
-
Use
docker-machine envto print the environment -
Use
DOCKER_HOSTandDOCKER_CERT_PATHfor TCP Connection -
Click on Test Connection
-
-
Docker for Mac
-
Start Docker for Mac
-
Configure using
Unix socket. Connection name ofmobyand socket ofunix:///var/run/docker.sockare 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/couchbaseimage -
Show output in
Progresswindow -
Properties of the image in
Propertieswindow
-
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 Containerspane, 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, showInfoandInspect -
Docker Compose
-
Check out a project TODO
-
Select
docker-compose.yml, right-clickRun As→Docker Compose
-
-
In
Docker Imagesview, 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 Hierarchyto show the hierarchy of images -
Right-click on the container and click on
Runto 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 ImageandRun 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
Connector green arrow to connect to Docker Machine
-
-
Select top-level node
-
Click on
Pull image-
Show how multiple registries can be configured
-
-
Type
arungupta/couchbaseand pull
-
Select an image, click on
Create container -
Select
After launchand enter the URL ashttp://192.168.99.100:8091 -
Go to
Containertab, addPort bindingsfor8091: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 directorytodocker-dir -
Click on
OK
-
-
Create
Dockerfilein 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 -
Deploymenttab-
Select
After launch, change the URL tohttp://192.168.99.100:18080/helloweb/index.jsp -
In
Before launch, addBuild Artifactsand select the artifact
-
-
Containertab-
Add
Port bindingsfor8080:8080
-
-
-
View,Tool Windows,Docker, connect to it -
Run the project
-
Preferences,Build, Execution, Deployment,Clouds, set the path ofdocker-composeto/usr/local/bin/docker-compose. -
Create a
docker-compose.ymlindocker-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.ymlinDeployment: -
Run the project and show the running containers under
Compose