DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Microservices With Apache Camel and Quarkus
  • What ChatGPT Needs Is Context
  • A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage

Trending

  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Microservices With Apache Camel and Quarkus
  • What ChatGPT Needs Is Context
  • A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Running Apache Tomcat in Windows Containers

Running Apache Tomcat in Windows Containers

If you're using Windows containers, check out WinDocks' latest support for Java and Tomcat.

Paul Stanton user avatar by
Paul Stanton
·
Nov. 07, 16 · Tutorial
Like (6)
Save
Tweet
Share
14.53K Views

Join the DZone community and get the full member experience.

Join For Free

windocks is a port of docker’s open source to windows, supporting all editions of windows 8, windows 10, windows server 2012, and windows server 2016, and now including a new “base” windows container (similar to docker’s scratch container for linux). the new windows container is designed to support “container ready” executables, and works great with tomcat, jetty, nginx, and node.js.

in this article, we’ll look at windocks' new support for java and tomcat, based on the free windocks community edition .

comparing windocks to microsoft's windows server 2016 implementation

the windocks setup is an automated 15-minute install on any edition of windows 8, windows 10, windows server 2012, and windows server 2016. windocks uses standard docker commands, which can be run locally or from a remote client. in this article we’ll use a local client on a windows 8 home edition laptop as our container server!

windows containers behave like linux containers, with speed, portability of containers and images, and great economy. a survey of windocks customers shows an average reduction in vms used of 5x, and for dev and test usage the reduction in vms averages close to 10x.

how does windocks compare to microsoft’s container support on windows server 2016?

  • microsoft’s supports windows server 2016 and windows 10 enterprise editions only, while windocks supports all editions of windows 8 and windows server 2012 onward.
  • microsoft has two sql server express dockerfiles on dockerhub, but provides no build time support for attaching sql server databases! windocks supports all editions of sql server 2008 onward, with dockerfile support for adding or mounting databases and running sql server scripts. sql server containers built using windocks are complete and ready for use.

windocks support of java and tomcat

windocks ships with a \samples folder that includes dockerfiles for ngnix, node.js, tomcat, jetty, and of course .net and sql server. the tomcat test folder is shown below, along with a sample dockerfile. the dockerfile uses the new “windows” image, along with tomcat version 7.0.72, and a powershell script that sets the tomcat server port to the container port.

image title

if you have a war file, it could be added with an additional copy command, or it could be pulled from the appropriate repo. the command to build the container is >docker build <path>. the “testjavatomcat” folder is included in the windocks samples directory. each container includes a unique containerid, and an assigned port (underlined below). we then start the container using the >docker start <id>.

image title

opening a browser to localhost:<port> (we’re working on the windocks host), we can see our container is built and running. windows task manager also confirms that we have java.exe running in a container.

image title

create a tomcat image

now that we’ve created a running container, we can commit this as an image, with >docker commit <containerid> <imagename>. once saved we can create as many identical, isolated containers as needed. saved and tested images become artifacts in a continuous integration process. we’ll write again soon about the new windocks jenkins build plugin.

each tomcat container is built with a dockerfile that includes a script to ensure the tomcat port is matched to the container port. again, the container has a containerid, and port, and we can start it as shown.

image title

the result is easily confirmed with a refreshed browser pointing to the new container port.

image title

do more, faster, and spend less!

if you haven’t explored the use of containers, now is the time! windocks customers use a single vm to support a team of developers or testers, saving time and money. one windocks customer uses a bare metal host with 8 cores and 96 gb of ram, to support twenty sql server containers for dev and test. each container includes over twenty large databases! prior to using containers, each vm took over an hour to provision. using windocks the time is down to a couple of minutes. the result is a 20x reduction in vms, a 5:1 reduction in cpu cores, and a dramatic financial savings in ms license costs.

Docker (software) Apache Tomcat

Opinions expressed by DZone contributors are their own.

Trending

  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Microservices With Apache Camel and Quarkus
  • What ChatGPT Needs Is Context
  • A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: