dockbs on freebsd 11.1

时间:2017-12-30 19:49:33

标签: docker freebsd jail

我正在尝试在FreeBSD 11.1上运行docker,但是我在构建我的docker镜像时遇到了问题,例如,如果我使用https://github.com/dockerfile/ubuntu/blob/master/Dockerfile并构建它,我会收到以下错误:

khine@dhegdheer  ~/Sandboxes/docker  docker build -t ubuntu-on-freebsd .
Sending build context to Docker daemon  2.56 kB
Sending build context to Docker daemon 
Step 0 : FROM ubuntu:14.04
14.04: Pulling from ubuntu
ee0f4a516087: Pull complete 
d9a62ff590c6: Pull complete 
3ce5430e3227: Pull complete 
1ded2a02619b: Pull complete 
2b0bc23c3028: Pull complete 
aacde6a2c2eb: Pull complete 
Digest: sha256:f30e8ac4eb1048d60012fbf4791a072152950e3a339dadbd43c4ff8c0e198528
Status: Downloaded newer image for ubuntu:14.04
 ---> aacde6a2c2eb
Step 1 : RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list &&   apt-get update &&   apt-get -y upgrade &&   apt-get install -y build-essential &&   apt-get install -y software-properties-common &&   apt-get install -y byobu curl git htop man unzip vim wget &&   rm -rf /var/lib/apt/lists/*
 ---> Running in 3bc6b0fe4f31
Err http://archive.ubuntu.com trusty InRelease

Err http://security.ubuntu.com trusty-security InRelease

Err http://archive.ubuntu.com trusty-updates InRelease

Err http://archive.ubuntu.com trusty-backports InRelease

Err http://archive.ubuntu.com trusty Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-updates Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://security.ubuntu.com trusty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Err http://archive.ubuntu.com trusty-backports Release.gpg
  Could not resolve 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease  

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease  

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease  

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease  

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Could not resolve 'archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'archive.ubuntu.com'

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Could not resolve 'archive.ubuntu.com'

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package build-essential
jail: /bin/sh -c sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list &&   apt-get update &&   apt-get -y upgrade &&   apt-get install -y build-essential &&   apt-get install -y software-properties-common &&   apt-get install -y byobu curl git htop man unzip vim wget &&   rm -rf /var/lib/apt/lists/*: failed
The command '/bin/sh -c sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list &&   apt-get update &&   apt-get -y upgrade &&   apt-get install -y build-essential &&   apt-get install -y software-properties-common &&   apt-get install -y byobu curl git htop man unzip vim wget &&   rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1

其中,按照https://wiki.freebsd.org/Docker运行正常拉动:

khine@dhegdheer  ~/Sandboxes/docker  docker run -t -i ubuntu /bin/bash
root@:/# uname -a
Linux  2.6.32 FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

这是docker版本:

 khine@dhegdheer  ~/Sandboxes/docker  docker version
Client version: 1.7.0-dev
Client API version: 1.19
Go version (client): go1.9
Git commit (client): 582db78
OS/Arch (client): freebsd/amd64
Server version: 1.7.0-dev
Server API version: 1.19
Go version (server): go1.9
Git commit (server): 582db78
OS/Arch (server): freebsd/amd64

看起来Docker容器无法从监狱中突破,因为我可以进入监狱,按照:

root@dhegdheer:/usr/home/khine/Sandboxes/docker # jls
   JID  IP Address      Hostname                      Path
    13  172.17.0.12                                   /usr/docker/zfs/graph/8099a1566348
root@dhegdheer:/usr/home/khine/Sandboxes/docker # jexec 13 bash
root@:/# uname -a
Linux  2.6.32 FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@:/#

我错过了什么?任何建议都非常感谢。

0 个答案:

没有答案