linux tomcat session 共享,docker linux centos tomcat session 共享问题

docker linux centos tomcat session 共享问题

37.6 安装一个 session 共享的 tomcat

37.6.0  准备工作

需要一个 curiousby/centos-ssh-root-java-tomcat

需要 commons-pool2-2.2.jar jedis-2.5.2.jar tomcat-redis-session-manage-tomcat.jar

37.6.1 编辑 tomcat  context.xml

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

-->

WEB-INF/web.xml

37.6.2 编辑 dockerfile

############################################

# version:apache-tomcat-7.0.75

# desc : 当前版本安装的7.0.75

############################################

# 设置继承自我们创建的 tools 镜像

FROM curiousby/centos-ssh-root-java-tomcat:original

# 下面是一些创建者的基本信息

MAINTAINER baoyou curiousby@163.com

COPY context.xml /usr/local/tomcat/conf/

COPY commons-pool2-2.2.jar /usr/local/tomcat/lib/

COPY jedis-2.5.2.jar /usr/local/tomcat/lib/

COPY tomcat-redis-session-manage-tomcat.jar /usr/local/tomcat/lib/

37.6.3 执行命令

docker build -t curiousby/centos-ssh-root-java-tomcat-session:original .

docker run -d -v /home/baoyou/soft/centos-ssh-root-java-tomcat-session/jenkins/:/usr/local/tomcat/webapps/ -p 8080:8080 curiousby/centos-ssh-root-java-tomcat-session:original

37.6.4 运行日志

Sending build context to Docker daemon 245.6MB

Step 1/6 : FROM curiousby/centos-ssh-root-java-tomcat:original

---> 7dd208c74262

Step 2/6 : MAINTAINER baoyou curiousby@163.com

---> Running in c3fa61a42d5d

---> 6d26863ed093

Removing intermediate container c3fa61a42d5d

Step 3/6 : COPY context.xml /usr/local/tomcat/conf/

---> 69fb214698f6

Removing intermediate container 5c2c3a14da7f

Step 4/6 : COPY commons-pool2-2.2.jar /usr/local/tomcat/lib/

---> 3a020dc6a710

Removing intermediate container df207dc60e6f

Step 5/6 : COPY jedis-2.5.2.jar /usr/local/tomcat/lib/

---> c88143473183

Removing intermediate container 34323368ef8a

Step 6/6 : COPY tomcat-redis-session-manage-tomcat.jar /usr/local/tomcat/lib/

---> fea957b8ad41

Removing intermediate container b715482e29ab

Successfully built fea957b8ad41

Successfully tagged curiousby/centos-ssh-root-java-tomcat-session:original

37.6.5 测试

http://192.168.206.238:8080/jenkins/

e3528929456e237b8c965dd2c8970a85.png

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信 以及扣扣群),没钱捧个人场,谢谢各位。

谢谢您的赞助,我会做的更好!

参与评论 您还未登录,请先 登录 后发表或查看评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:深蓝海洋 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值