我在我的Ubuntu 13.10(Saucy Salamander)上安装了Docker,当我输入我的控制台时:
sudo docker pull busybox
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Pulling repository busybox
2014/04/16 09:37:07 Get https://index.docker.io/v1/repositories/busybox/images: dial tcp: lookup index.docker.io on 127.0.1.1:53: no answer from server
Run Code Online (Sandbox Code Playgroud)
Docker版本:
$ sudo docker version
Client version: 0.10.0
Client API version: 1.10
Go version (client): go1.2.1
Git commit (client): dc9c28f
Server version: 0.10.0
Server API version: 1.10
Git commit (server): dc9c28f
Go version (server): go1.2.1
Last stable version: 0.10.0
Run Code Online (Sandbox Code Playgroud)
我在没有身份验证的代理服务器后面,这是我的/etc/apt/apt.conf文件:
Acquire::http::proxy "http://192.168.1.1:3128/";
Acquire::https::proxy "https://192.168.1.1:3128/";
Acquire::ftp::proxy "ftp://192.168.1.1:3128/";
Acquire::socks::proxy "socks://192.168.1.1:3128/";
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我正在运行Mac OS 10.9.5,我已经按照https://docs.docker.com/installation/mac/来安装docker .即使boot2docker VM在后台运行,我运行docker时也会收到超时错误消息.
nikhil@macbook ~> boot2docker status
running
nikhil@macbook ~> boot2docker ip
The VM's Host only interface IP address is: 192.168.59.103
nikhil@macbook ~> docker run hello-world
2014/11/01 01:01:31 Post https://192.168.59.103:2376/v1.15/containers/create: dial tcp 192.168.59.103:2376: i/o timeout
nikhil@macbook ~> docker search ubuntu
2014/11/01 01:02:40 Get https://192.168.59.103:2376/v1.15/images/search?term=ubuntu: dial tcp 192.168.59.103:2376: i/o timeout
Run Code Online (Sandbox Code Playgroud)
我已经验证了docker在boot2docker vm中运行并且我的端口是正确的.
nikhil@macbook ~> boot2docker ssh
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / …Run Code Online (Sandbox Code Playgroud) 我理解export(对于容器)和save(对于图像)之间的区别.但是在一天结束时,保存或导出产生的tarball应该用作图像.
那么为什么有两个命令来从tarball制作图像呢?
docker build -t oreng/iojs .
INFO[0000] Get https://index.docker.io/v1/repositories/library/iojs/images: x509: certificate signed by unknown authority.
Run Code Online (Sandbox Code Playgroud)
我的Dockerfile是
FROM iojs:latest
RUN useradd -ms /bin/bash developer
WORKDIR /home/developer
USER developer
Run Code Online (Sandbox Code Playgroud)
另外hub create(使用https://github.com/github/hub)
Post https://api.github.com/user/repos: x509: certificate signed by unknown authority
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Docker在公司代理服务器后面设置开发环境.尽我所能,我无法让docker容器与代理服务器通信.
代理服务器和apt-get在主机上工作正常,即Ubuntu 12.04
在Dockerfile中完成的第一件事是尝试设置代理变量:
FROM ubuntu
RUN echo 'Acquire::http { Proxy "http://my.proxy.net:8000"; };' >> /etc/apt/apt.conf.d/01proxy
ENV HTTP_PROXY http://my.proxy.net:8000
ENV http_proxy http://my.proxy.net:8000
ENV HTTPS_PROXY https://my.proxy.net:8000
ENV https_proxy https://my.proxy.net:8000
RUN apt-get update && apt-get install -y build-essential
Run Code Online (Sandbox Code Playgroud)
它将图像拉得很好,设置了变量,但是当它进入apt-get update时,它会尝试一段时间然后失败并:
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-security/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'my.proxy.net'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'my.proxy.net'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'my.proxy.net'
W: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用带有rails的docker,在一个容器内构建一个完整的堆栈.我的结论是使用runit作为进程管理器的nginx/memcached/unicorn/rails/postgres堆栈.到目前为止,我安装了我的app,ruby和postgres.此时我正在尝试测试一切是否正常工作,然后再继续使用nginx/memcached/unicorn.
这是我的dockerfile:
FROM ubuntu:trusty
ADD . /app
# Update repos
RUN apt-get update
# General
RUN apt-get install -y git curl software-properties-common python-software-properties ssh
# Install ruby (taken from https://gist.github.com/konklone/6662393)
RUN \curl -Lk https://get.rvm.io | bash -s stable
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.1.1"
ENV PATH /usr/local/rvm/gems/ruby-2.1.1/bin:/usr/local/rvm/rubies/ruby-2.1.1/bin:$PATH
RUN gem install bundler --no-ri --no-rdoc
# Install nodejs (rails js runtime)
RUN apt-get install -y nodejs
# Install postgresql (adapted from https://wiki.postgresql.org/wiki/Apt)
RUN echo "deb …Run Code Online (Sandbox Code Playgroud) 我在Windows 7上安装了boot2docker(完全安装),我正在尝试运行容器端口重定向演示:
docker run --rm -i -t -p 80:80 nginx
Run Code Online (Sandbox Code Playgroud)
看起来它没有完全正确完成,它只是停止,看起来像这样:

当我打开另一个git bash shell并运行时boot2docker ip我得到192.168.59.103,当我在chrome中弹出它时我得到Error code: ERR_CONNECTION_TIMED_OUT
在Ubuntu 14.04上使用普通的docker它对我来说很好.我还需要做些什么才能在windows上使用boot2docker?
基本上,在重新启动VM时,我在SSH连接到VM时所做的任何更改都会丢失.我假设当我停止VM时问题与错误相关联.
C:\Users\Tom>boot2docker stop
error in run: Failed to stop machine "boot2docker-vm": exit status 1
Run Code Online (Sandbox Code Playgroud)
但是,我可能只是在做一些愚蠢的事情.
我遵循的顺序如下(docker logo elided),您可以看到它在重新启动时丢失了示例目录.
C:\Users\Tom>boot2docker up
Waiting for VM and Docker daemon to start.......................ooo
Started.
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead.
C:\Users\Tom>boot2docker ssh
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker@boot2docker:~$ ls
boot2docker, please format-me …Run Code Online (Sandbox Code Playgroud) 我在Windows上安装了boot2docker.我试图在以下链接(https://github.com/boot2docker/boot2docker-cli/issues/230)的帮助下配置代理,但它不起作用.
当我执行时boot2docker download,我有以下错误:
boot2docker download
Latest release for github.com/boot2docker/boot2docker is v1.6.0
Downloading boot2docker ISO image...
error in run: Failed to download ISO image: Get https://s3.amazonaws.com/github-cloud/releases/14930729/0573f322-e442-11e4-8500-b1bbe904b032.iso?response-content-disposition=attachment%3B%20filename%3Dboot2docker.iso&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1430303112&Signature=oTercMri%2FkqD9cbA315JhNHzehk%3D:
Proxy Authentication Required
Run Code Online (Sandbox Code Playgroud) 我刚刚创建了我的第一个 docker 容器并且它运行成功。我现在的问题是我无法访问默认存储它们的文件夹
/var/lib/docker/containers
它不断抛出错误
can't cd to containers
docker ×10
boot2docker ×6
proxy ×2
virtualbox ×2
windows ×2
apt-get ×1
dns ×1
docker-image ×1
github ×1
x509 ×1