Free tools Windows power users keep installed
One-click scans. No signup required.
To deploy a Java web application in Docker, package the application as a WAR, choose a Tomcat image whose release and Java runtime satisfy that application, copy the WAR into the image’s documented deployment directory, build the image, and publish Tomcat’s listening port when you start the container. A Dockerfile’s EXPOSE line documents a port; it does not make that port reachable from the host.
Antihost offers VPS plans with one-click Docker, NVMe storage and a 14-day free trial.
The exact Tomcat image tag, Java level, build command, WAR filename, and deployment directory must be checked for your project. Tomcat’s default Host appBase is $CATALINA_BASE/webapps, but an image can change its configuration. The procedure below separates what Tomcat documents from values you must verify.
As an Amazon Associate I earn from qualifying purchases.
What the deployment looks like
The finished path has four artifacts and one network mapping:
- Your existing Java web project produces a Web Application Archive, normally ending in
.war. - A Tomcat base image supplies the application server and its Java runtime environment.
- A Dockerfile copies the WAR into the image’s configured Tomcat deployment directory.
docker buildcreates an image containing Tomcat and the application.docker run -p hostPort:containerPortstarts a container and maps a host port to Tomcat’s container port.
Tomcat accepts either an unpacked web-application directory or a packed WAR. Its documented default Host appBase is $CATALINA_BASE/webapps; applications placed there can be deployed at startup. See the Apache Tomcat Application Developer’s Guide deployment documentation for the appBase and startup-deployment behavior.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Docker’s Java guide distinguishes an executable JAR from an application that depends on an application server. For the latter category, it directs you to use the relevant server as the base image and adjust the package filename as required by the project. That is the model used here: Tomcat remains the server, while your WAR is the deployable application.
Before you write the Dockerfile
Identify the application contract
Record the Servlet or Jakarta Servlet API level expected by the application, the Java runtime it requires, the artifact filename produced by the build, and whether the application expects a particular Tomcat configuration. Those values are project-specific and are not inferable from the application title alone. A WAR compiled for one API family is not automatically compatible with every Tomcat generation.
Recommended Free Tools
Choose a compatible Tomcat release
Do not select the newest Tomcat release solely because it is newest. Compare the APIs your application targets, its Java requirement, and the maintenance policy you want for the deployment. The Apache Tomcat 11.0.27 documentation index, dated October 6, 2026, identifies Servlet 6.1 and Pages 4.0 as the APIs implemented by that release. Those numbers describe Tomcat 11.0.27; they do not prove that an unspecified application is compatible with it. The release documentation is at https://tomcat.apache.org/tomcat-11.0-doc/index.html.
Verify the selected image’s layout
Image maintainers can set environment variables, change the active CATALINA_BASE, or use a deployment directory different from the default. Check the documentation for the exact image tag before hard-coding a destination in COPY. Tomcat’s default appBase is a useful reference, not permission to assume that every image has the same filesystem layout.
Keep the build context intentional
Docker’s build context is the set of files available to COPY. Put the Dockerfile and the WAR in a context that contains only what the image needs, and make sure the WAR is produced before the image build starts. The Dockerfile reference explains that FROM selects a base image and COPY transfers files into the image; the Dockerfile overview describes how docker build uses the Dockerfile and context. Consult Docker’s Dockerfile reference and the Dockerfile overview.
Step 1: Build the WAR
Use the build system already defined by the project to produce the deployable WAR. The exact Maven, Gradle, or other command is project-specific, so use the command in that project’s build instructions rather than copying a command that may not match its plugins or profiles.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
After the build completes, locate the resulting file and note its exact name. For the examples below, the file is called myapp.war; replace that name with the artifact your build actually creates. If the build creates an unpacked directory instead of a WAR, either configure the build to package a WAR or use the directory form supported by Tomcat. A packed WAR is usually the clearest artifact to copy into an image because it gives the image build one explicit input.
- Confirm that the file ends in
.war. - Confirm that it contains the web application’s classes and web resources produced by the build.
- Confirm that its API and Java requirements match the Tomcat image you intend to use.
- Keep the artifact in the Docker build context, or change the build context so Docker can read it.
Step 2: Create a Dockerfile that copies the WAR
The following pattern leaves the image tag as a build argument so you can supply the verified Tomcat image rather than silently assuming a tag:
ARG TOMCAT_IMAGE
FROM ${TOMCAT_IMAGE}
COPY myapp.war $CATALINA_BASE/webapps/
EXPOSE 8080
Set TOMCAT_IMAGE to the image and tag you have checked for your application’s API and Java requirements. The COPY source must match the WAR filename in the build context. The destination uses Tomcat’s documented default appBase. If the selected image documents another path, use that path instead.
What each instruction does
ARG TOMCAT_IMAGEandFROM: select the Tomcat base image. The image supplies the server; your application is added in a later layer.COPY: transfers the WAR from the build context into the image. A typo in the source filename or destination path prevents the expected deployment.EXPOSE 8080: records that the image intends to use container port 8080. Docker’s reference states, “The EXPOSE instruction doesn’t actually publish the port.” Publishing happens only when the container is run with a port mapping.
If your Tomcat configuration listens on a different container port, document that port in EXPOSE and use the same container-port value in docker run. Do not treat EXPOSE as a firewall rule or host binding.
When the root context matters
With Tomcat’s default naming convention, a WAR named myapp.war is commonly available at /myapp. The root application is a special case; its context is not the same as an ordinary filename-derived context. The Tomcat Manager documentation covers application deployment and context handling at https://tomcat.apache.org/tomcat-9.0-doc/manager-howto.html. Decide the URL you expect before testing, and make the artifact name or context configuration agree with it.
Step 3: Build the Docker image
Run the build from the directory containing the Dockerfile and WAR. The image name below is an example chosen for readability:
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
docker build --build-arg TOMCAT_IMAGE="$TOMCAT_IMAGE" -t my-tomcat-app .
Set the shell variable to the verified image reference before running the command. For example, in a shell you could assign the value supplied by your image documentation, then execute the build command. The important points are that the argument resolves to a real, compatible image and that the final dot supplies a context containing both the Dockerfile and myapp.war.
Docker reads the Dockerfile, pulls the FROM image if necessary, copies the WAR, and produces the tag my-tomcat-app. A successful image build does not prove that the application itself starts correctly; it proves that Docker could assemble the filesystem described by the Dockerfile.
Build failures to resolve immediately
- Source file not found: the WAR is outside the build context or its filename does not match the
COPYinstruction. Move the artifact into the context or correct the source name. - Base image cannot be resolved: the value supplied for
TOMCAT_IMAGEis not a valid image reference available to your Docker engine. Recheck the selected image documentation and tag. - Application and image mismatch: the image builds successfully, but compatibility problems appear only when Tomcat loads the application. Revisit the Servlet/Jakarta API and Java requirements before changing deployment paths.
Step 4: Run the container and publish Tomcat’s port
If Tomcat listens on container port 8080, start the image with a host-to-container mapping:
docker run --rm -p 8080:8080 my-tomcat-app
The first number is the host port; the second is the container port. This command makes the service reachable through port 8080 on the Docker host while Tomcat continues listening on 8080 inside the container. You may choose another host port, such as 9090:8080, when 8080 is already occupied. If the selected Tomcat image listens on a different container port, replace the second number accordingly.
Docker’s port-publishing documentation describes the -p hostPort:containerPort form at https://docs.docker.com/engine/network/port-publishing/. The Dockerfile reference at https://docs.docker.com/reference/dockerfile explains why an EXPOSE declaration alone is insufficient.
Test the URL that matches the context path
Open the host address and the context path derived from the WAR. With the illustrative mapping and filename, the first URL to try is http://localhost:8080/myapp. If the application is configured as the root context, test http://localhost:8080/ instead. A 404 at the wrong context path can look like a deployment failure even when Tomcat has started and deployed the WAR correctly.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Use the container’s startup output and the Tomcat configuration selected by the image to determine whether deployment completed. A browser request by itself cannot distinguish a wrong URL from a failed deployment, so check both the path and the server startup result.
Static deployment versus Manager deployment
Copying a WAR into the image is static deployment: the artifact is present before Tomcat starts. Tomcat also supports dynamic deployment through its Manager application while the server is running. The two approaches solve different operational problems.
| Deployment mode | When the artifact is introduced | Restart behavior | Operational model | Access concern |
|---|---|---|---|---|
| Static image deployment | WAR or expanded application is placed in the appBase before startup | Tomcat discovers it during startup | Build a new image when the application artifact changes | Protect the Docker host and image pipeline |
| Manager deployment | WAR is submitted to a running Tomcat Manager application | Deployment can occur without restarting Tomcat | Runtime administration through Manager operations | Restrict Manager to authorized administrators |
For a newly built container intended to run one application, Manager is not required. Static deployment keeps the application artifact and server image together, making the container’s contents explicit. Manager is useful when your operating process requires deployment to a running server, but it introduces an administrative interface that must be protected and governed. Tomcat’s Manager guide documents its deployment and management operations at https://tomcat.apache.org/tomcat-9.0-doc/manager-howto.html.
Choosing the Tomcat and Java combination
Compatibility is a decision, not a default. Start with the APIs and Java level declared by the application, then choose a Tomcat release and image that satisfy them. Check all of the following before building:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Servlet API family and level: determine whether the application targets the API provided by your selected Tomcat generation.
- Pages/JSP requirements: applications using server-side pages may require a particular Pages API level.
- Java runtime: match the image’s runtime to the version required by the application and its dependencies.
- Maintenance policy: decide whether you need a maintained release line, and record the exact image tag so later builds are reproducible.
- Image configuration: verify the active
CATALINA_BASE, appBase, listening port, and any startup options documented for that image.
Tomcat 11.0.27 is documented as implementing Servlet 6.1 and Pages 4.0 in the October 6, 2026 index. That is a concrete version fact, not a universal recommendation. If your application targets another API level, select the Tomcat release that matches the application’s contract and verify the corresponding image documentation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting by symptom
The container starts, but the application returns 404
- Confirm that the WAR was copied to the image path used by the selected Tomcat configuration. The default documented appBase is
$CATALINA_BASE/webapps. - Confirm that Tomcat started without a deployment error.
- Check the URL’s context path. A WAR named
myapp.warnormally maps to/myappunder the default naming convention; it is not automatically the root application. - Check whether the application uses an explicitly configured context that overrides the filename-derived path.
A 404 at / does not prove that /myapp failed, and a 404 at /myapp does not prove that the container port is unpublished. Separate path checks from server and network checks.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
The application cannot be reached from the host
- Identify the port on which Tomcat listens inside the container.
- Ensure the
docker runcommand maps a host port to that exact container port, for example-p 8080:8080. - Do not rely on
EXPOSE; it records intent but does not publish the port. - If the host port is already in use, select a different host-side number while keeping the container-side number unchanged.
Deployment fails or classes and APIs are missing
Recheck the application target against the Tomcat and Java combination. A newer Tomcat generation can expose a different Servlet or Pages API than the one for which the WAR was built. Verify the selected release documentation, image tag, and Java runtime instead of trying random destination paths.
The WAR is not available during the build
Docker can copy only files in its build context. Run the build from a context that includes the generated WAR, or place the Dockerfile where the intended context can see the artifact. Ensure the case-sensitive filename in COPY exactly matches the generated file.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Manager deployment is exposed too broadly
The Manager application performs runtime deployment and administration. Keep it restricted to authorized administrators and limit its exposure according to your environment. The exact access policy depends on where and how Tomcat runs; the Manager documentation describes the operations, while your deployment environment determines the controls.
What this workflow does not decide for production
The WAR-in-image pattern answers how to package and reach the application. It does not, by itself, define TLS termination, health checks, resource limits, persistent storage, secrets management, backups, logging retention, or orchestration. Those choices depend on the environment in which the container will run. Add them deliberately rather than assuming that a successful local port mapping provides production hardening.
Likewise, a successful image build is not an application acceptance test. Validate the application with the checks appropriate to its own endpoints, dependencies, and data stores. Keep the Tomcat image tag, WAR build inputs, and runtime configuration recorded so a later rebuild uses the same compatibility decisions.
Quick Recap
End-to-end checklist
- The project builds a WAR with the expected filename.
- The WAR’s Servlet/Jakarta API and Java requirements are known.
- The selected Tomcat release and image tag satisfy those requirements.
- The image documentation confirms the deployment directory and listening port.
- The Dockerfile’s
COPYsource matches the WAR in the build context. - The destination matches the selected image’s active Tomcat appBase.
EXPOSEdocuments the intended container port but is not treated as host publication.docker buildcompletes with the intended image tag.docker run -pmaps an available host port to Tomcat’s actual container port.- The test URL includes the context path derived from the WAR name or configured explicitly.
- Any Manager deployment interface is limited to authorized administration.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




