zoukankan      html  css  js  c++  java
  • 容器中安装telnet命令

    Ubuntu安装telnet命令(容器)

    1. 查看已经运行的容器
      查看容器的jar包
    #docker exec -it a45560456a1d ls
    

    查看jar包所在路径

    #docker exec -it a45560456a1d pwd
    

    复制jar包到宿主机

    #docker cp a45560456a1d:/vonedao-gateway/vonedao-tenant-gateway.3.7.0.jar ./
    

    在git上找到Dockerfile文件进行添加下面3行内容

    #vi Dockerfile
    
    RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list && echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list && echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list && echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
    RUN apt-get update
    RUN apt-get install telnet -y
    

    保存后进行打包

    #docker build . -t docker.vonedao.com/vonedao-cs/gateway:v1
    

    修改yaml文件,使用新镜像docker.vonedao.com/vonedao-cs/gateway:v1,启动

    启动:
    docker stack deploy -c vonedao-tenant-gateway.yaml gateway

    使用telnet进行检查:

    alpine安装telnet工具(容器)

    # docker exec -it 容器id /bin/sh
    #  apk update
    # apk add busybox-extras
    使用telnet试试:
    # busybox-extras telnet 192.168.2.95 3307
    

  • 相关阅读:
    Mysql集群
    JAVA 经典算法 40 例
    公司面试问题总结
    面试题6
    面试题5
    Java自学-JDK环境变量配置
    mybatis中#{}和${}的区别
    JVM系列(四)— 原子性、可见性与有序性
    JVM系列(三)— Java内存模型
    Java基础拾遗(一) — 忽略的 Integer 类
  • 原文地址:https://www.cnblogs.com/zoujiaojiao/p/12753071.html
Copyright © 2011-2022 走看看