The container interconnect in Docker is a more complex topic, and the details are described in the following sections. To continue with the first 2 chapters, we created a MySQL container and a tomcat container that can use "docker ps" to see their status. [emailprotected] ~/base $ docker pscontainer ID IMAGE COMMAND CR
Author: Sit forget peak font: [Increase decrease] Type: Reprint time: 2016-10-08 I would like to comment on how to deploy Tomcat in Docker and how to deploy our application to Tomcat in the Docker container, which is described in detail and has reference value. , let's have a look.
let's start with a simple
If you need to replace or add a file to the old Tomcatimage to form a new image, you need to do something in Dockerfile
From Old_tomcat
#这里可以使用docker官方的镜像, the following descriptions are examples of
maintainer ****************** on this basis
#如果需要替换原有的配置文件或者脚本
ADD web.xml/usr/local/tomcat/webapps/manager/web-inf/
Add tomcat-users.xml/usr/local/
Docker + nginx + Tomcat 7 Simple Server Load balancer ConfigurationThis article describes how to configure Simple Server Load balancer on Docker. The host machine is Ubuntu 14.04.2 LTS, two CentOS containers, Nginx installed on the host machine, and tomcat 7 installed on the two containers. The architecture is as follo
First, Docker pulls the Tomcat image, as shown in figure:
Second, install the Tomcat container, as shown:
Note:--link Connect to MySQL (otherwise the DB cannot be accessed.) Each container is independent)
Tomcat_mysql is an alias. DB configured as: tomcat_mysql:3306
Third, if the 80 port is occupied, then stop Tomca
Using the Docker container to run Tomcat, because the same host ran a number of containers, plus the host itself ran a lot of processes, resulting in the total number of processes 8000+, and the container in Tomcat's startup script will call the setenv.sh, There is such a sentence in setenv.sh ulimit-u 8192, because the number of system processes has reached 8192, so when you start
Docker deployed program after access to Chinese is garbled, (for CentOS 6 mirroring)Docker default is POSIXAdd in DockerfileENV LANG en_US. UTF-8System time is UTC 8 HoursAdd in DockerfileRun/bin/cp/usr/share/zoneinfo/asia/shanghai/etc/localtimeRun/bin/echo-e "zone=" Asia/shanghai "\nutc=false\nrtc=false" >/etc/sysconfig/clockSee if the language changesDocker exec-t container name localeSee if the time is r
Docker deployed program after access to Chinese is garbled, (for CentOS 6 mirroring)Docker default is POSIXAdd in DockerfileENV LANG en_US. UTF-8System time is UTC 8 HoursAdd in DockerfileRun/bin/cp/usr/share/zoneinfo/asia/shanghai/etc/localtimeRun/bin/echo-e "zone=" Asia/shanghai "\nutc=false\nrtc=false" >/etc/sysconfig/clockSee if the language changesDocker exec-t container name localeSee if the time is r
get service
View the details of this service.Kubectl describe service Kube-tomcat service details the IP here is Cluster-ip. Cluster-ip is bound to the service. Service details the port here is the service's port number. Service details The Nodeport here is the true port number of node. Service details the endpoints here is the IP and port of the container.
View the created Pod:kubectl get pod
See the details of one of the pods. Pod details h
DescriptionMultiple tomcat containers, while starting and shutting down, use pipework control for each Docker container's network management. This script is used to manage the creation, deletion, startup, and shutdown of multiple containers. The user can modify it by itself.#!/bin/bash#chkconfig:23451190#description:docker $NameBEGIN =1end=4name= Apihost= "$Name" mem=2048mcontainer_web_dir= "/
Tags: dockerScenario One: Use wget to download the latest version of Tomcat build when Docker is created#centos7+oraclejdk7+tomcat7 from centos:centos7 maintaineryuj Scenario Two: Build with the Tomcat compression package downloaded on the Docker server (apache-tomcat-7.0.63
Dockerfile content is as follows:
From ubuntu:14.04
#刷新包缓存 and install wget tools
RUN apt-get update apt-get install-y wget
#设置工作目录
Workdir/home
# Install JDK
RUN wget--no-cookies--no-check-certificate--header "cookie:gpw_e24=http%3a%2f% 2fwww.oracle.com%2ftechnetwork%2fjava%2fjavase%2fdownloads%2fjdk7-downloads-1880260.html;oraclelicense= Accept-securebackup-cookie "Http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
RUN tar-zxf jdk-7u79-linux-x64.tar.gz
# Config
Tomcat supports autonomous applications and opens ports:1. Making DockerfileBased on CentOS, remote SSH login: New Dockerfile, edited as follows:From Tomcatmaintainer ******************add web.xml/usr/local/tomcat/webapps/manager/web-inf/add tomcat-users.xml/ Usr/local/tomcat/conf/add server.xml/usr/local/
1. Java DockerfileCreate the project directory Java, upload the required Java version of the compressed package in the directory, and create the Dockerfile file, the project structure is as follows:Java-dockerfile-jdk-8u111-linux-x64.gzDockerfile content:# java# Version 1.8.0_111# source_imagefrom centos# maintainer_infomaintainer bluemooder [email protected]add jdk-8u111-linux-x64.gz/usr/local/# envenv java_home/usr/local/jdk1.8.0_111env PATH $JAVA _home/bin: $PATHCreate a Java image based on d
-network
Run Docker network LS again, you can see the my-network you just created, scope is swarm, this network can be used in swarm mode, and the containers on multiple nodes can be exchanged.
When you create a service in swarm, you can specify the network to use through the--network network name. Multiple service if you use the same scope as Swarm network, you can communicate with each other by the name of the service.
network, you can communicate with each other by the name of the service.
Docker swarm simple to use
Below a brief introduction to the use of Docker swarm, interested can view the Docker official documents for in-depth understanding.
The commands below are all running at the Swarm leader node!!
Docker Service Creat
modify and templating.# VERSION 1.0.0# default CentOS, can be changed to any image you need from CentOS# signature Maintainer Wupher "[email protected]" RUN Echo ' We are running some# of cool things ' run Yum update run yum install-y openssh-serverrun mkdir-p/var/run/sshd# set root ssh telnet password RUN echo "Roo t:123456 "| Chpasswdrun Yum install-y mysql-serverrun yum install-y java-1.7.0-openjdk# install tomcat etc...# mount the hard drive for
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.