docker部署gateone
因为项目中使用了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相关推荐
- Docker 部署 SpringBoot 项目整合 Redis 镜像做访问计数Demo
Docker 部署SpringBoot项目整合 Redis 镜像做访问计数Demo 最终效果如下 大概就几个步骤 1.安装 Docker CE 2.运行 Redis 镜像 3.Java 环境准备 4. ...
- Docker 部署SpringBoot项目不香吗?
点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 作者:流星007 链接:toutiao.com/i68433912 ...
- docker部署springboot_Docker+SpringBoot快速构建和部署应用
前言 Docker技术发展为当前流行的微服务提供了更加便利的环境,使用SpringBoot+Docker部署和发布应用,其实也是一件比较简单的事情.当前,前提是得有Docker的基础. 构建一个Spr ...
- docker初体验:docker部署nginx负载均衡集群
Docker 是一个用于开发,交付和运行应用程序的开放平台.Docker 使您能够将应用程序与基础架构分开,从而可以快速交付软件.今天来为大家演示一下docker部署nginx负载均衡集群 环境 ce ...
- docker初体验:docker部署nginx服务
Docker 是一个用于开发,交付和运行应用程序的开放平台.Docker 使您能够将应用程序与基础架构分开,从而可以快速交付软件.今天来为大家演示一下docker部署nginx 环境 centos7 ...
- Docker系列 四.Docker部署SpringBoot
四.Docker部署SpringBoot 环境&工具: 阿里云轻量级服务器.CentOS 7系统.FinalShell(其他连接客户端也可以).IDEA 1. 创建springboot项目 这 ...
- Docker部署文档
Docker部署文档 目录 Docker部署文档 1 一.什么是Docker 3 1.1Docker简介 3 1.2对比传统虚拟机总结 4 1.3Docker通常用于如下场景: 5 1.4基本概念 5 ...
- Docker部署Zookeeper集群
Docker部署Zookeeper集群 官方网站: http://zookeeper.apache.org/ http://zookeeper.apache.org/doc/r3.4.8/zookee ...
- 部署go的web应用_使用Docker部署Go Web应用
为什么需要Docker? 使用docker的主要目标是容器化.也就是为你的应用程序提供一致的环境,而不依赖于它运行的主机. 想象一下你是否也会遇到下面这个场景,你在本地开发了你的应用程序,它很可能有很 ...
最新文章
- java如何确保单线程_java – 任何单线程程序如何成为有效的多线程程序?
- 说说 MySQL 子查询
- asp.net oracle优化,[转]ASP.NET性能优化
- 第一篇:数据库基本管理(mysql)
- Linux下oracle数据库启动和关闭操作
- 基于NOPI的Execl模板转换类,直接将Execl模板转换对应的Entity
- 电脑怎么进入linux系统,Linux操作系统进入家用电脑成为发展新前景
- ASP.Net中防止页面刷新重复提交的几种方法
- 嵌入式系统开发笔记94:使用FlyMcu连接STM32开发板
- 文件上传到QQ邮箱文件中转站,链接
- DSP6678 中断程序
- k8s安装calico网络插件
- android 清理系统垃圾,安卓手机怎么清理系统垃圾
- Maya布料解算入门
- 计算机读研的收获和遗憾
- 如何配置CK-S610-A01半导体读写器的RFID工具擦写TI低频玻璃管标签RI-TRP-DR2B-40的UID号
- 苹果手机聊天记录恢复方法有哪些?这2个恢复技巧值得收藏
- javaScript判断当前浏览器(谷歌、火狐、IE)兼容IE11
- 米的换算单位和公式_英寸和厘米的换算、英尺和米的换算及英寸和毫米的单位换算公式...
- python代码画乌龟_乌龟教你Python编程——“玫瑰花”是怎么画的!