因为项目中使用了gateone实现webssh功能,因此研究了一下geteone的部署方式。发现物理机上经常会出现gateone部署失败的情况,因此使用了docker方式实现gateone的部署。

直接使用官方提供的gateone镜像时,因为tornado版本原因,造成无法启动情况,报错如下:

TypeError: __init__() got an unexpected keyword argument 'io_loop'
Exception AttributeError: "'AutoExpireDict' object has no attribute '_key_watcher'" in <bound method AutoExpireDict.__del__ of {}> ignored

因此自己重新制作镜像,注意:python-imaging需要更换为:python-pil,同时更改了启动脚本代码:update_and_run_gateone.py

目录结构:

[root@container1 gateone]# cat Dockerfile
FROM ubuntu
MAINTAINER Dan McDougall <daniel.mcdougall@liftoffsoftware.com>
ENV GATEONE_REPO_URL https://github.com/liftoff/GateOne.git
# Ensure everything is up-to-date
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update --fix-missing && apt-get -y upgrade
# Install dependencies
RUN apt-get -y \install python-pip \python-pil \python-setuptools \python-mutagen \python-pam \python-dev \git \telnet \openssh-client && \apt-get -y clean && \apt-get -q -y autoremove
#RUN pip install --upgrade futures tornado cssmin slimit psutil
RUN pip install --upgrade futures cssmin slimit psutil && pip install tornado==4.5.3# Create the necessary directories, clone the repo, and install everything
RUN mkdir -p /gateone/logs /gateone/users /etc/gateone/conf.d /etc/gateone/ssl && \cd /gateone && \git clone $GATEONE_REPO_URL && \cd GateOne && \python setup.py install && \cp docker/60docker.conf /etc/gateone/conf.d/60docker.conf
# This ensures our configuration files/dirs are created:
RUN /usr/local/bin/gateone --configure \--log_file_prefix="/gateone/logs/gateone.log"
# Remove the auto-generated key/certificate so that a new one gets created the
# first time the container is started:
RUN rm -f /etc/gateone/ssl/key.pem && \rm -f /etc/gateone/ssl/certificate.pem
# (We don't want everyone using the same SSL key/certificate)
COPY ./script/update_and_run_gateone.py /usr/local/bin/update_and_run_gateone
EXPOSE 8000
CMD ["/usr/local/bin/update_and_run_gateone", "--log_file_prefix=/gateone/logs/gateone.log"]
[root@interkgcentos7 gateone]# cat update_and_run_gateone.py
#!/usr/bin/env python"""
Checks if Gate One is up-to-date inside the container by performing a
`git pull`.  If new code was pulled it will be automatically installed via
`python setup.py install`Once that's done it will automatically run the 'gateone' command; passing it any
arguments that were passed to this script.To disable the automatic update mechanism simply pass --noupdate as a command
line argument to this script... note::This script will also update the Tornado framework via the pip command.
"""import os, sys
try:from commands import getstatusoutput
except ImportError: # Python 3from subprocess import getstatusoutputif __name__ == "__main__":os.chdir('/gateone/GateOne')os.execvp('/usr/bin/python', ['/usr/bin/python', '/usr/local/bin/gateone'])os._exit(0)
[root@container1 gateone]# cat docker-compose.yml
version: "3"
services:gateone:image: mygateonecontainer_name: gateonevolumes:#将gateone配置文件挂载到本机,为了以后进行修改,如https改为http- ./etc/conf.d:/etc/gateone/conf.d#将默认ssh免密码登录路径挂载到本机- ./gateone/users:/gateone/usersports:- 6001:8000restart: alwaysnetworks:- zabbixnetworks:zabbix:external: true  

操作步骤:

1、创建镜像:docker build -t mygateone ./

2、创建网络:docker network create zabbix

3、启动容器:docker-compose up -d

4、停止容器,同时将https改为http访问

5、重新启动容器,同时检查是否使用http协议和8000端口:docker-compose up -d && docker logs -f gateone

6、检查gateone是否正常工作

gateone实现ssh免密码登录

cp ~xxx/.ssh/id_rsa*  /www/xxx/.ssh/ # 其中www为10server.conf中user_dir中指定的目录, xxx为gateone访问时upn用户

echo id_rsa > .default_ids

注意:需要同时将id_rsa和id_rsa.pub都拷贝到该目录才能实现免密码登录

gateone默认使用https协议,启动容器后会默认自动生成证书

docker部署gateone相关推荐

  1. Docker 部署 SpringBoot 项目整合 Redis 镜像做访问计数Demo

    Docker 部署SpringBoot项目整合 Redis 镜像做访问计数Demo 最终效果如下 大概就几个步骤 1.安装 Docker CE 2.运行 Redis 镜像 3.Java 环境准备 4. ...

  2. Docker 部署SpringBoot项目不香吗?

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 作者:流星007 链接:toutiao.com/i68433912 ...

  3. docker部署springboot_Docker+SpringBoot快速构建和部署应用

    前言 Docker技术发展为当前流行的微服务提供了更加便利的环境,使用SpringBoot+Docker部署和发布应用,其实也是一件比较简单的事情.当前,前提是得有Docker的基础. 构建一个Spr ...

  4. docker初体验:docker部署nginx负载均衡集群

    Docker 是一个用于开发,交付和运行应用程序的开放平台.Docker 使您能够将应用程序与基础架构分开,从而可以快速交付软件.今天来为大家演示一下docker部署nginx负载均衡集群 环境 ce ...

  5. docker初体验:docker部署nginx服务

    Docker 是一个用于开发,交付和运行应用程序的开放平台.Docker 使您能够将应用程序与基础架构分开,从而可以快速交付软件.今天来为大家演示一下docker部署nginx 环境 centos7 ...

  6. Docker系列 四.Docker部署SpringBoot

    四.Docker部署SpringBoot 环境&工具: 阿里云轻量级服务器.CentOS 7系统.FinalShell(其他连接客户端也可以).IDEA 1. 创建springboot项目 这 ...

  7. Docker部署文档

    Docker部署文档 目录 Docker部署文档 1 一.什么是Docker 3 1.1Docker简介 3 1.2对比传统虚拟机总结 4 1.3Docker通常用于如下场景: 5 1.4基本概念 5 ...

  8. Docker部署Zookeeper集群

    Docker部署Zookeeper集群 官方网站: http://zookeeper.apache.org/ http://zookeeper.apache.org/doc/r3.4.8/zookee ...

  9. 部署go的web应用_使用Docker部署Go Web应用

    为什么需要Docker? 使用docker的主要目标是容器化.也就是为你的应用程序提供一致的环境,而不依赖于它运行的主机. 想象一下你是否也会遇到下面这个场景,你在本地开发了你的应用程序,它很可能有很 ...

最新文章

  1. java如何确保单线程_java – 任何单线程程序如何成为有效的多线程程序?
  2. 说说 MySQL 子查询
  3. asp.net oracle优化,[转]ASP.NET性能优化
  4. 第一篇:数据库基本管理(mysql)
  5. Linux下oracle数据库启动和关闭操作
  6. 基于NOPI的Execl模板转换类,直接将Execl模板转换对应的Entity
  7. 电脑怎么进入linux系统,Linux操作系统进入家用电脑成为发展新前景
  8. ASP.Net中防止页面刷新重复提交的几种方法
  9. 嵌入式系统开发笔记94:使用FlyMcu连接STM32开发板
  10. 文件上传到QQ邮箱文件中转站,链接
  11. DSP6678 中断程序
  12. k8s安装calico网络插件
  13. android 清理系统垃圾,安卓手机怎么清理系统垃圾
  14. Maya布料解算入门
  15. 计算机读研的收获和遗憾
  16. 如何配置CK-S610-A01半导体读写器的RFID工具擦写TI低频玻璃管标签RI-TRP-DR2B-40的UID号
  17. 苹果手机聊天记录恢复方法有哪些?这2个恢复技巧值得收藏
  18. javaScript判断当前浏览器(谷歌、火狐、IE)兼容IE11
  19. 米的换算单位和公式_英寸和厘米的换算、英尺和米的换算及英寸和毫米的单位换算公式...
  20. python代码画乌龟_乌龟教你Python编程——“玫瑰花”是怎么画的!

热门文章

  1. 如何画一个平行四边形 ios
  2. 微信tt服务器,微信,TT,禁令解除
  3. Flash Rom存储器W25Q16/W25X16
  4. Python网络解析库Xpath,妈妈再也不会担心我不会解析了
  5. 广金强智教务系统模拟登录
  6. mysql统计-关于学生成绩
  7. 西部数据HC570 22TB HDD 技术讲解
  8. 张维真:夫妻相处的人生哲学
  9. CString学习俏狐总结
  10. slat-ssh部署salt-minion