本文描述了如何在POWER8服务器上搭建一个本地化的Docker镜像仓库,主要涉及镜像制作,Docker Registry服务启动等。希望能够对在非X86服务器上搭建Docker仓库的同学提供参考。
声明:本文仅作为个人学习使用!

第一步,在服务器上启动一个KVM虚拟机(ip: 172.16.13.221),编译Docker生成可执行文件,启动Docker Daemon服务。可参考我的另一篇文档。

第二步,制作Registry镜像
  由于Ubuntu环境中暂时还没有docker registry镜像,需要自己制作
  1,制作Ubuntu14:04基础镜像
  $ sudo apt-get install -y debootstrap
  $ curl -o debootstrap.sh https://raw.githubusercontent.com/docker/docker/master/contrib/mkimage/debootstrap
  $ chmod 755 debootstrap.sh
  $ sudo ./debootstrap.sh ubuntu --components=main,universe trusty
  $ sudo tar -C ubuntu -c . | docker import - ubuntu:14.04
  $ docker tag ubuntu:14.04 ubuntu:trusty
  $ docker tag ubuntu:14.04 ubuntu:latest
  $ sudo rm -fr ubuntu

  $ docker images
  REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
  ubuntu 14.04 78c113d93188 59 seconds ago 197.6 MB
  ubuntu latest 78c113d93188 59 seconds ago 197.6 MB
  ubuntu trusty 78c113d93188 59 seconds ago 197.6 MB

  2,下载docker-registry
  $ git clone https://github.com/docker/docker-registry
  3,打补丁
  $ cd ~/docker-registry
  $ cat ~/docker-registry/docker-registry.patch
*** docker-registry.orig/Dockerfile Sat Jan 31 07:20:32 2015
--- docker-registry/Dockerfile Sat Jan 31 13:12:11 2015
***************
*** 19,24 ****
--- 19,27 ----
libssl-dev \
liblzma-dev \
libevent1-dev \
+ # Install deps for building gevent
+ curl \
+ cython \
&& rm -rf /var/lib/apt/lists/*

COPY . /docker-registry
***************
*** 27,32 ****
--- 30,45 ----
# Install core
RUN pip install /docker-registry/depends/docker-registry-core

+ # Install gevent 1.0.1 using updated config.guess and config.sub
+ RUN curl https://pypi.python.org/packages/source/g/gevent/gevent-1.0.1.tar.gz | tar -xzf - -C / \
+ && curl -o /gevent-1.0.1/libev/config.guess \
+ 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' \
+ && curl -o /gevent-1.0.1/libev/config.sub \
+ 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' \
+ && cp -pf /gevent-1.0.1/libev/config.guess /gevent-1.0.1/c-ares/config.guess \
+ && cp -pf /gevent-1.0.1/libev/config.sub /gevent-1.0.1/c-ares/config.sub \
+ && pip install /gevent-1.0.1
+
# Install registry
RUN pip install file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors]
  $ patch -p1 < docker-registry.patch

  4,制作Registry镜像
  $ docker build -t registry .
  Removing intermediate container bc9ea34e0252
  Successfully built 2be3e95c5b2f

第三步,启动Registry服务
  $ docker run -d -p 5000:5000 registry
  [2015-12-09 06:28:48 +0000] [1] [INFO] Starting gunicorn 19.1.1
  [2015-12-09 06:28:48 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
  [2015-12-09 06:28:48 +0000] [1] [INFO] Using worker: gevent
  [2015-12-09 06:28:48 +0000] [13] [INFO] Booting worker with pid: 13
  [2015-12-09 06:28:48 +0000] [14] [INFO] Booting worker with pid: 14
  ......

  $ docker ps
  CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  266b27fb6d5b registry "docker-registry" 22 seconds ago Up 20 seconds 0.0.0.0:5000->5000/tcp goofy_jennings

第四步,上传镜像到registry
  我在有Registry容器的KVM中上传镜像总是遇到连接错误,后来没有解决。就尝试在另一个KVM里面上传,结果成功了。
  1,在另一个KVM中启动docker Daemon
  2,使用docker import将之前制作的文件放入本地docker 系统中
  3,配置docker.conf文件,设置registry地址(172.16.13.221:5000),使用--insecure-registry参数,然后restart docker Daemon。
  在/ect/init/docker.conf中添加
  DOCKER_OPTS="--insecure-registry 172.16.13.221:5000"

  $ps -aux
  /usr/bin/docker daemon --insecure-registry 172.16.13.221:5000
  4,给待上传的镜像打上tag
  $ docker tag f3b2472e2593 172.16.13.221:5000/ubuntu
  $ docker images
  REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
  172.16.13.221:5000/ubuntu latest f3b2472e2593 2 days ago 188.3 MB
  ubuntu 14.04 f3b2472e2593 2 days ago 188.3 MB
  ubuntu latest f3b2472e2593 2 days ago 188.3 MB
  ubuntu trusty f3b2472e2593 2 days ago 188.3 MB
  5,Push镜像(传输可能中断,需要多尝试几次)
  $ docker push 172.16.13.221:5000/ubuntu
  The push refers to a repository [localhost:5000/ubuntu] (len: 1)
  Sending image list
  Pushing repository 172.16.13.221:5000/ubuntu (1 tags)
  f3b2472e2593: Image successfully pushed

  $ docker search 172.16.13.221:5000/ubuntu
  NAME DESCRIPTION STARS OFFICIAL AUTOMATED
  library/ubuntu 0

参考资料:
  Build and use Docker on the IBM POWER Linux platform
  https://www.ibm.com/developerworks/library/d-docker-on-power-linux-platform/

在Ubuntu14.04系统POWER8服务器上搭建Docker Registry服务的更多相关文章

  1. Ubuntu14.04下FTP服务器的搭建配置 标签: ubuntuftp服务器虚拟机 2017-06-13 15:24 161人阅读 评

    首先说明一下,我是在虚拟机中装的Ubuntu14.04,物理机是Win10,最初只是为了在两个系统间传输文件才在Ubuntu中安装了ftp服务器,从Windows端登陆其即可.最初也是按照网上的各种教 ...

  2. Ubuntu14.04 mount远程服务器上的目录

    备忘用. 一,远程服务器设置: 1,在/etc/exports中添加如下配置: /home/xxx *(insecure,rw,sync,no_root_squash,anonuid=123,anon ...

  3. 在一台服务器上搭建多个网站的方法(Apache版)

    Apache的配置文件一般放置在/etc/httpd/conf文件夹下,httpd.conf是它的主配置文件,在进行配置时可以将虚拟主机的配置文件单独配置,如取名为vhost.conf,然后再http ...

  4. 在 Ubuntu 18.04 LTS 无头服务器上安装 Oracle VirtualBox

    作者: Sk 译者: LCTT qhwdw | 2018-10-12 01:59 本教程将指导你在 Ubuntu 18.04 LTS 无头服务器上,一步一步地安装 Oracle VirtualBox. ...

  5. 手把手教你在VMware虚拟机中安装Ubuntu14.04系统

    在VMware中创建完虚拟机之后,一般需要给虚拟机安装系统,比较受青睐的系统有Ubuntu和Centos,关于Centos系统的安装之前已经写过了,感兴趣的小伙伴可以戳这篇文章:靠谱的centos7. ...

  6. 基于Ubuntu14.04系统的nvidia tesla K40驱动和cuda 7.5安装笔记

    基于Ubuntu14.04系统的nvidia tesla K40驱动和cuda 7.5安装笔记 飞翔的蜘蛛人 注1:本人新手,文章中不准确的地方,欢迎批评指正 注2:知识储备应达到Linux入门级水平 ...

  7. 在MAC服务器上搭建docker-registry(转)

    在MAC服务器上搭建docker-registry 2014-03-14      0个评论    来源:在MAC服务器上搭建docker-registry   收藏    我要投稿 本文介绍如何在M ...

  8. PHP绿色集成环境在云服务器上的应用,PHPWAMP在服务器上搭建网站案例

    问:什么叫WAMP?答:Windows下的Apache+Mysql+PHP,称之为WAMP. 本文案例采用的PHP集成环境是我自己开发的纯绿色版WAMP软件(PHPWAMP). 我在这款集成环境里集成 ...

  9. 阿里云ECS服务器上搭建keepalived+mha+mysql5.6+gtid+一主两从+脚本判断架构踩的坑

    最近,公司项目搭建了一套后端数据库架构,不是在RDS,是在阿里云的ECS服务器上搭建keepalived.mha.mysql5.6.gtid.一主两从架构,目前还没有实现读写分离,以后架构升级,可能代 ...

随机推荐

  1. XSHELL使用隧道

    线上系统中,搭建了一个elasticsearch环境,想要访问页面,发现环境的内网中没有windows机器,无法使用浏览器来直接进行web页面的访问,于是直接使用了XSELL中强大的功能"隧 ...

  2. loadRunner录制脚本常见问题及解决方法

    1.是用IE9录制IE浏览器异常关闭 系统:win7 LR:11 浏览器:IE9 lr使用IE9录制脚本时,浏览器异常关闭且lr报the recording of the application wa ...

  3. google你懂得

    地址 https://github.com/racaljk/hosts

  4. MySql使用游标Cursor循环(While)更新数据

    #要修改的变量 DECLARE var_ID VARCHAR(50) DEFAULT ''; #需要修改的数据的数量 DECLARE var_UpdateCount INT; #当前循环次数 DECL ...

  5. SQLServer将表数据导出为Insert语句

    从网上找到的方法,不过很不错,记录下来,也算是分享下~~ 有一个表,city,有列:cityID,cityName;将此表中所有数据,变为insert语句 select 'insert into ta ...

  6. HBASE学习笔记-初步印象

    HBASE概念: HBASE是一个分布式架构的数据库,通过对数据进行多层的分块打散储存.从而改写传统数据库的储存能力和读取速度. HBASE的集群服务器: HBASE的集群主要分为Zookeeper集 ...

  7. Centos6.5 gitlab安装使用

    公司从svn转到git做版本管理,我搜了一下网上git的服务器,包括gitosis,gitolite等.一开始我是用的是gitosis作为git服务器的,安装过程还算比较简单,整个服务使用python ...

  8. Python 基礎 - 文件操作_v2

    嗯,那如何要把游標的位置給打印來? #!/usr/bin/env python3 # -*- coding:utf-8 -*- f = open('test', 'r') print(f.tell() ...

  9. 发一则自己创作的Lae程序员小漫画,仅供一乐

  10. 前后台数据交互 后台封装数据 json格式

    namespace ~.sverIterface { public class EventPlayerInfo { public string name { get; set; } public st ...