Docker combat Tomcat Deployment web App

Source: Internet
Author: User
Tags docker cp docker run

1. Pull Tomcat

Docker pull Tomcat

2. Start the Tomcat server (here, pull the Tomcat image, which includes the JDK)

8888 (Host machine Port):8080(Docker Tomcat container port) Tomcat

3. Start in an interactive form, go to the Tomcat container and look at the file directory---find the WebApps directory

Docker exec-it My-tomcat7/bin/bash

This is a direct view of the mirrored warehouse, which also has a path address.

4. Copy the ready-to-use web app to the Docker My-tomcat container, where it is automatically deployed after it is copied and can be accessed directly

Docker CP Docker.war My-tomcat:/usr/local/tomcat/webapps

Here's the one in my notes ... When I did not know what to read when the record ... I don't know what to do with it.

5. Run the interactive shell
Docker Pull Base
# Run an interactive shell in the base image,
# Allocate a TTY, attach stdin and stdout
Docker Run-i-T Base/bin/bash


6. Start a long-running work process
# Run Docker in daemon mode
(docker-d | | echo "Docker daemon already Running") &

# Start A very useful long-running process
job=$ (Docker run-d base/bin/sh-c "while true; do Echo Hello world; Sleep 1; Done ")

# Collect The output of the job so far
Docker logs $JOB

# Kill The Job
Docker Kill $JOB

Docker combat Tomcat Deployment web App

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.