Installing Tomee Web Server through Docker File For Windows Container

Installing Tomee Web Server through Docker File For Windows Container

Installing Tomee Web Server through Docker File For Windows Container

In this blog, we will show you installing tomee web server through docker file for Windows container

 

REQUIREMENTS

  • Windows container host with Docker service installed.
  • Base windows server core image.
  • JAVA & TOMEE Installation files.

 

DOWNLOAD JRE SETUP FILE

image_thumb10

 

  • Click on Agree and Start Free Download to download the file.

image_thumb7

 

DOWNLOAD JDK SETUP FILE

image11_thumb

 

  • Click on the jdk8u131_windows-x64.exe link to download the JDK file.

image_thumb3

 

DOWNLOAD TOMEE

image

 

  • Extract the downloaded zip to a folder named tomee

 

PREPARING THE ENVIRONMENT FOR BUILDING TOMEE CONTAINER IMAGE

  • Create a new folder named tomee under c:\ drive using below command.

New-Item -Type Directory -Name tomee -Path c:\

image

 

  • Now create a new folder named setup under c:\tomee folder.

New-Item -Type Directory -Name setup -Path C:\tomee\

image

 

  • Create a new file name as dockerfile under c:\tomee folder.

New-Item -Type File -Name dockerfile -Path C:\tomee\

image

 

  • Open the file dockerfile in notepad and paste the below content.

# THIS DOCKER FILE WAS DEVELOPED BY ASSISTANZ NETWORKS

# SPECIFY THE CONTAINER IMAGE
FROM microsoft/windowsservercore

# COPY THE TOMEE INSTALLATION FILES INTO THE CONTAINER
ADD ./setup c:/source

RUN powershell.exe -command \

# INSTALLING JAVA JRE
./source/jre.cmd; \

# INSTALLING JAVA JDK
./source/jdk.cmd; \

# COPYING TOMEE SETUP FILES TO C Drive
Copy-Item c:/source/tomee -Destination c:/tomee -Recurse; \

# SETTING UP ENVIRONMENT PATH VARIABLES FOR JRE & JDK FOLDERS
./source/Environmentvariable.ps1; \

# Installing Tomee service
cmd.exe /c c:/source/tomeeservice.bat; \

# SET TOMEE SERVICE TO RUN UNDER LOCAL SYSTEM ACCOUNT
sc.exe config tomee obj=LocalSystem start=auto; \

# REMOVE TOMEE SETUP FILES FROM SOURCE DIRECTORY
cmd.exe /c rd /S /Q c:\source

image

 

  • Copy the downloaded JDK, JRE & TOMEE setup files in C:\tomee\setup folder.

image

 

  • Create a new file named jre.cfg in C:\tomee\setup folder.

image

 

  • Add the below content in jre.cfg file and save it.

INSTALL_SILENT=Enable
SPONSORS=Disable
NOSTARTMENU=Enable
REBOOT=Disable
EULA=Disable
AUTO_UPDATE=Disable
STATIC=Enable

 

  • Create a new file named jre.cmd and add the below content and save it.

image

pushd %~dp0
start /wait jre-8u131-windows-x64.exe INSTALLCFG=%~dp0jre.cfg

 

  • Create a new file named jdk.cmd and add the below content and save it.

image

pushd %~dp0
start /wait jdk-8u131-windows-x64.exe INSTALLCFG=%~dp0jre.cfg

 

  • Create a new file named Environmentvariable.ps1 and add the below content and save it.

[Environment]::SetEnvironmentVariable(“JRE_HOME”,”C:/Program Files/Java/jre1.8.0_131″)
[Environment]::SetEnvironmentVariable(“JAVA_HOME”,”C:/Program Files/Java/jdk1.8.0_131″)

image

 

  • Create a new file named tomeeservice.bat and paste the below content and save it.

cd\
cd .\tomee\bin\
.\service.bat install

image

 

  • We have completed the preparation part for tomee image deployment.

 

BUILDING THE IMAGE

  • Go to PowerShell window and execute the below command.

docker build -t tomee c:\tomee

image

 

  • It will take several minutes to complete the build process.

 

  • The build completed successfully.

image

 

VERIFYING THE IMAGE

  • Launch a new container using the below command.

docker run -it tomee powershell

image

 

  • Once the container is up and running, verify the tomee service status.

Get-Service tomee

image

 

  • Type ipconfig to find the container IP address.

image

 

  • Browse the container IP (172.28.239.183) with default port number 8080 from the container host.

image

 

  • You can download the script files from the GitHub URL.

https://github.com/assistanz247/Tomee

image

 

  • You can download the pre-built tomee image from the Docker hub URL.

https://hub.docker.com/r/assistanz247/tomee-windows/

 

image

 

VIDEO:

 

Thanks for reading this blog. We hope it was useful for you to learn how to build tomee web server container image using docker file.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support