容器中安装telnet命令
Ubuntu安装telnet命令(容器)
- 查看已经运行的容器
查看容器的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