使用host模式搭建dockyard环境
来源:互联网 发布:fm2016开档曼联数据 编辑:程序博客网 时间:2024/06/08 16:42
一、在宿主主机的相关配置
1)下载docker的bin文件,步骤如下:
wget https://get.docker.com/builds/Linux/x86_64/docker-1.8.3mv docker-1.8.3 dockercp docker /usr/bin
2)配置containerops网络
打开 /etc/hosts,添加
127.0.0.1 containerops.me
二、在容器内的相关配置
1)配置runtime文件
vim dockyard/conf/runtime.conf添加如下内容:
runmode = devlistenmode = httpshttpscertfile = cert/containerops/containerops.crthttpskeyfile = cert/containerops/containerops.key[log]filepath = log/containerops-log[db]uri = localhost:6379registry = 0.9runmode = devlistenmode = httpshttpscertfile = cert/containerops/containerops.crthttpskeyfile = cert/containerops/containerops.key[log]filepath = log/containerops-log[db]uri = localhost:6379passwd = containeropsdb = 8[dockyard]path = datadomains = containerops.meregistry = 0.9distribution = registry/2.0standalone = true
apt-get update && apt-get install redis-server打开/etc/redis/redis.conf配置文件,找到requirepass关键字(一般在330行),然后屏蔽这一行,在下一行添加requirepass containerops
3)编写Dockerfile,编译镜像
Dockerfile内容如下:
FROM ubuntu:latestMAINTAINER Yuzhilong <yuzhilong@chiasoftinc.com>RUN apt-get update --fix-missing && apt-get install -y --force-yes redis-serverCOPY dockyard /home/dockyardCOPY redis.conf /etc/redis/redis.confCOPY docker_bin /home/docker_binWORKDIR /home/dockyard#CMD service redis-server start && ./dockyard web --address=127.0.0.1 --port=5000CMD service redis-server start && ./dockyard web --address=0.0.0.0 --port=5000#CMD service redis-server start && ./dockyard web编译镜像:docker build -t dockyard .
注意:此时Dockerfile文件是和dockyard目录处于同一级的。
三、测试镜像
1)启动容器:
docker run --rm -it --net=host dockyard
2)启动docker守护进程
--insecure-registry containerops.me &或者直接
docker daemon &
3)执行以下命令
docker pull containerops.me/mabin/busybox
注意:如果启动容器时没有指定--net=host则pull镜像时会出现以下错误:
Using default tag: latestPulling repository containerops.me/mabin/busyboxError while pulling image: Get http://containerops.me/v1/repositories/mabin/busybox/images: dial tcp 127.0.0.1:80: connection refused
三、在其它电脑的虚拟机上访问本机的容器服务
1)将两台电脑的虚拟机都设置为桥接模式
2)将客户端的/etc/hosts文件中的containerops.me修改为服务端的IP地址
3)启动服务端的容器,注意要将服务端的防火墙关闭
0 0
- 使用host模式搭建dockyard环境
- <QNX> Linux Host开发环境搭建
- host-only模式的hadoop-1.2.1伪分布式搭建
- 基于PC搭建CoretexA15 KVM环境(1)——host环境搭建
- mv5使用环境搭建
- Eclipse 使用环境搭建
- appium环境搭建、使用
- FastDFS环境搭建使用
- MVC开发模式环境搭建
- 保护模式实验环境搭建
- Hadoop单机模式环境搭建
- Hadoop分布式模式环境搭建
- spark standalone模式 环境搭建
- hive独立模式环境搭建
- spark环境搭建--Standalone模式
- Hive多用户模式环境搭建
- (zybo)Qt&Opencv host编译环境和交叉编译环境的搭建
- 【hadoop 2.6】hadoop2.6伪分布模式环境的搭建测试使用
- LocalNotification本地通知
- 如何更改tomcat7及以上版本内存设置
- 构建一个倒排索引 A first take at building an inverted index
- 邮件开发:邮件内容组织结构、复杂邮件的编写API
- 在selenium测试中使用XPATH功能函数starts-with、contains、descendant、ancestor、text()定位网页元素
- 使用host模式搭建dockyard环境
- UITableView中刷新单行cell与单个section段的方法
- 一大第15位代表-尼克尔斯基
- Mac中常用的终端命令
- Transductive Learning vs Inductive Learning
- Make a Neon Vector Shooter for iOS: The Warping Grid
- ARM内核全解析,从ARM7,ARM9到Cortex-A7,A8,A9,A12,A15到Cortex-A53,A57
- 【LinkIt One】驱动无法安装,提示“系统找不到指定的文件”
- nginx queue设计