Docker Tutorials for Java DevelopersConsider a scenario - You have just joined a new organization as a developer. You will now have to setup the project with the assistance of a fellow developer. He suggests you follow certain steps for setting up the required environment and then start the project deployable like a WAR. You do the same, but keep getting some or other issues regarding environment configuration. May be even your fellow developer has forgot some configuration property he might have set. Well you are stuck in such a situation. This is known as Dependency Hell. Other similar scenario of this dependency hell are - The application is running on my dev machine but not in production. Dont know what issue is. There is also other scenarios like Matrix of Hell. But this is mostly related to DEVOPS people. Docker to the rescue.
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
VideoThis tutorial is explained in the below Youtube Video.
This is done using a docker image.
An image is a lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files.
So an existing fellow developer will create an image of his environment and share it with the new developer. The new developer will just have to run the image as a docker container.
A container is a runtime instance of an image what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so. So the following scenarios we can consider the use of docker for Java Developers-
- Sharing development workspace, with preconfigured development environment.
- Continuous integration is one of the most popular use cases for Docker. Teams looking build and deploy their applications quickly use Docker, combined with ecosystem tools like Jenkins, to drive apps from dev, testing staging and into production without having to change any code.
- Running UAT's using Docker
Also Docker is a very vast topic, but we will be covering as to what is needed for Java Developers. Also docker involves lots of commands. We have created a single page to note down all the docker commands we will using.
Also for all docker example have Centos image and Oracle VM for running the examples.