Docker on FreeBSD

我要开发同款
匿名用户2015年07月19日
45阅读
所属分类Google Go、Docker扩展、云计算、Docker 扩展
授权协议Apache

作品详情

DockeronFreeBSD是Docker在FreeBSD系统上的移植版本。Docker原本是为Linux所开发设计,而最新的FreeBSD11-CURRENT和10.2将提供对Docker的支持。该系统严重依赖ZFS、jail以及64位的Linux兼容层。

安装和使用方法:

# pkg install docker-freebsd ca_root_nss...New packages to be INSTALLED:        docker-freebsd: 06252015        ca_root_nss: 3.19.1_1        bash: 4.3.39_2        indexinfo: 0.2.3        gettext-runtime: 0.19.4        go: 1.4.2,1        sqlite3: 3.8.10.2        readline: 6.3.8The process will require 155 MiB more space.26 MiB to be downloaded....You will need to create a ZFS dataset on /usr/docker# zfs create -o mountpoint=/usr/docker <zroot>/docker And lastly enable the docker daemon# sysrc -f /etc/rc.conf docker_enable="YES"# service docker start

启动信息:

# service docker onestartStarting docker...# docker versionClient version: 1.7.0-devClient API version: 1.19Go version (client): go1.4.2Git commit (client): 582db78OS/Arch (client): freebsd/amd64Server version: 1.7.0-devServer API version: 1.19Go version (server): go1.4.2Git commit (server): 582db78OS/Arch (server): freebsd/amd64# docker search centosNAME                      DESCRIPTION                     STARS   OFFICIAL   AUTOMATEDcentos                    The official build of CentOS.   1122    [OK]ansible/centos7-ansible   Ansible on Centos7              45      [OK]...# docker pull centoslatest: Pulling from centosf1b10cd84249: Pull complete c852f6d61e65: Pull complete 7322fbe74aa5: Already exists centos:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.Digest: sha256:57554136c655abb33ecb7bb790b1db0279668d3763c3b81f31bc6c4e60e4a1f3Status: Downloaded newer image for centos:latest# docker imagesREPOSITORY        TAG      IMAGE ID       CREATED       VIRTUAL SIZEcentos            latest   7322fbe74aa5   4 weeks ago   172.2 MB# docker run -t -i centos /bin/bash[root@ /]# uname -aLinux  2.6.32 FreeBSD 11.0-CURRENT #5 r285594: Tue Jul 14 23:30:11 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

运行状态:

# docker psCONTAINER ID  IMAGE   COMMAND      CREATED        STATUS        PORTS  NAMES920bc5fbb45c  centos  "/bin/bash"  9 seconds ago  Up 8 seconds         jolly_poincare# jls   JID  IP Address   Hostname   Path     3  172.17.0.3              /usr/docker/zfs/graph/920bc5fbb45c# zfs list...zroot/docker                                                                         119M   107G  6.02M  /usr/dockerzroot/docker/03a7a57df9197f242484375c4bc2149248ded5aaafc4feb8e472d6774d495530          8K   107G   112M  legacyzroot/docker/03a7a57df9197f242484375c4bc2149248ded5aaafc4feb8e472d6774d495530-init   128K   107G   112M  legacy...# mount...x220i/docker on /usr/docker (zfs, local, noatime, nfsv4acls)x220i/docker/d03bcd7082d91179f58c8738f598f5af4db00307a47b5db255aefd30790e8bdc on /usr/docker/zfs/graph/d03bcd7082d9 (zfs, local, noatime, nfsv4acls)linprocfs on /usr/docker/zfs/graph/d03bcd7082d9/proc (linprocfs, local)linsysfs on /usr/docker/zfs/graph/d03bcd7082d9/sys (linsysfs, local)devfs on /usr/docker/zfs/graph/d03bcd7082d9/dev (devfs, local, multilabel)

Docker下的FreeBSD:

# docker search freebsdNAME                      DESCRIPTION                STARS   OFFICIAL   AUTOMATED...lexaguskov/freebsd        FreeBSD operating system   0...# docker pull lexaguskov/freebsd...Status: Downloaded newer image for lexaguskov/freebsd:latest# docker run -t -i lexaguskov/freebsd /bin/csh## df -hFilesystem                                                                      Size   Used   Avail Capacity  Mounted onzroot/docker/485f9654f69d5e9909344dd823dd0608f3734c433b667e9ec04492cc61ddbcfa   107G   176M   107G  0%        /

网络:

# docker run -t -i centos ping -c2 8.8.8.8WARNING: setsockopt(ICMP_FILTER): Protocol not availableWARNING: your kernel is veeery old. No problems.PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=15.0 ms64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=14.1 ms...# docker run -t -i centos /bin/bashecho "nameserver 8.8.8.8" >> /etc/resolv.conf...ping sun.comPING sun.com (156.151.59.35) 56(84) bytes of data.64 bytes from lb-legacy-sun-cms-ucf.oracle.com (156.151.59.35): icmp_seq=1 ttl=244 time=51.5 ms...
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论