Tag: curl

运行官方的领事docker形象

我正在尝试通过执行以下操作来运行官方的Docker镜像 docker pull consul docker run -d –name=dev-consul -p 8500:8500 consul 当我尝试使用curl访问领事服务器时,我得到一个空的答复 vagrant@docker:~$ curl localhost:8500/v1/catalog/nodes –verbose * Hostname was NOT found in DNS cache * Trying ::1… * Connected to localhost (::1) port 8500 (#0) > GET /v1/catalog/nodes HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:8500 > Accept: */* > * Empty reply from server * […]

从docker容器到主机超时的curl请求

我遇到了一个docker问题,我相信这是由于我在dockernetworking方面的知识存在差距。 我有一个运行nginx和php的docker镜像。 必要的端口暴露。 这里是我用来运行图像的简化命令。 docker run –name php-app -p 80:80 php-app 问题是,安装设置,PHP应用程序使用主机公用IPcurl到自己。 举个例子, curl http://105.15.25.120/phpsetup.php?setup 这个IP似乎是从容器内部无法访问的,因为curl超时 curl -vvv 105.15.25.120 About to connect() to 105.15.25.120 port 80 (#0) Trying 105.15.25.120… Connection timed out Failed connect to 105.15.25.120:80; Connection timed out Closing connection 0 curl: (7) Failed connect to 105.15.25.120:80; Connection timed out 我可以成功地从容器内curl到其他IP,而不是主机。 从主机使用curl工作正常,并不会导致任何奇怪的行为。 为了简单和testing,我已经用官方的nginx镜像重现了这个行为,以帮助得出结论,这不是我自己的形象的问题。 docker […]

不能使用curl使用docker API从tarball加载docker镜像

我的docker版本: [cloud-user@firstroot-1 curl]$ sudo docker version Client: Version: 1.10.0 API version: 1.22 Go version: go1.5.3 Git commit: 590d5108 Built: Thu Feb 4 18:34:50 2016 OS/Arch: linux/amd64 Server: Version: 1.10.0 API version: 1.22 Go version: go1.5.3 Git commit: 590d5108 Built: Thu Feb 4 18:34:50 2016 OS/Arch: linux/amd64 我想使用curl从tarball加载图像,但是失败了。 不过,我没有问题加载这个命令: **sudo docker load –input utuntu.tar** //works tarball信息 […]

卷不与docker远程API绑定

我正在尝试使用docker远程API来绑定卷。 我按照这里的方向,但它仍然不工作。 我的testing正在运行这两个curl命令 curl -X POST -H "Content-Type: application/json" http://localhost:4243/containers/create -d '{ "Image" : "ubuntu", "Cmd" : [ "ls", "-la"], "Volumes": { "/mnt": {} }, "WorkingDir" : "/mnt", "NetworkDisabled" : false }' curl -XPOST http://localhost:4243/containers/<whateverID>/start -d '{ "Binds": [ "/tmp/:/mnt:ro" ] }' api的文档很糟糕。 如果任何人甚至可以指出我在客户端代码中的那些可行的东西。 有没有人甚至得到这个工作或这是一个知道的问题?

pipe理员curl命令失败,退出56错误

我有这个curlcmd我本地在OSX上成功完成: curl -XPOST http://192.168.59.103:9200/inventoryindex {"acknowledged":true} 但是当它从dockerpipe理员运行它失败… ummmmm 2014-08-16 14:24:38,838 INFO supervisord started with pid 1 2014-08-16 14:24:39,842 INFO spawned: 'curl' with pid 9 2014-08-16 14:24:39,843 INFO spawned: 'elasticsearch' with pid 10 2014-08-16 14:24:39,844 INFO spawned: 'sshd' with pid 11 2014-08-16 14:24:39,853 INFO exited: curl (exit status 56; not expected) 我已经尝试了几个不同的命令的变体,结果相同:以下是supervisor命令的最新版本: [program:curl] command=curl –header "Content-Type:application/json" -XPOST […]

libcurl与Ubuntu 14.04上的ares

我读了这个post 但它回答了如何编译curl。 我知道。 我想replacelibcurl包。 所以当我安装软件aptitude的时候会知道libcurl存在。 当Ubuntu将更新,那么它不应该overrite libcurl。 sudo checkinstall 不build议,但大多数职位广告 sudo make install 例如http://www.howtogeek.com/105413/how-to-compile-and-install-from-source-on-ubuntu/ 如何在启用了ares的情况下安装curl 我想知道是否值得使用docker如果我需要与单个应用程序的ares libcurl 。

Docker容器无法使用主机名访问另一个容器

我有2个容器: docker run -d -p 9000:9000 –name="my-php" php-fpm:5.4 docker run -d –name="nginx" -p 80:80 -link my-php:web nginx 两个都运行得很好。 在nginx容器内,我可以使用该应用程序 curl http://myapp.dev 也来自主机。 我想要做的是相同的curl请求,但从我的PHP容器使用相同的“myapp.dev”主机名,howerver … curl:(7)无法连接到myapp.dev端口80:连接被拒绝 我可以使用容器的ip,但它不适合我。 即使我无法使用curl,我仍然可以ping其他容器,没有任何问题。 在nginx容器上: root@6252bfe9d545:/# env WEB_PORT_9000_TCP_PROTO=tcp HOSTNAME=6252bfe9d545 WEB_PORT_9000_TCP_ADDR=172.17.0.24 WEB_PORT_9000_TCP_PORT=9000 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/ NGINX_VERSION=1.7.9-1~wheezy SHLVL=1 HOME=/root WEB_NAME=/nginx/web WEB_PORT_9000_TCP=tcp://172.17.0.24:9000 WEB_PORT=tcp://172.17.0.24:9000 _=/usr/bin/env root@6252bfe9d545:/# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric […]

本地到远程复制超时或仅复制less量文档CouchDb

我运行在Docker(klaemo / couchdb)中安装couchdb,并有端口转发安装,以便它可用于我的本地计算机。 除了添加pipe理员用户之外,我还没有configuration这个数据库。 这些是我的虚拟机端口转发设置: 我可以打开本地主机:5984 / _utils,浏览安装中的数据,我可以实例化从AWS中的远程数据库复制到这个couchDB,但如果我以另一种方式启动复制,它永远不会更新在被褥(所有我得到的是菜单栏中的微调)。 如果我用Curl进行复制,就像这样: curl -X POST http://localhost:5984/_replicate -d '{"source":"http://username:password@localhost:5984/database-name","target":"http://username:password@remote.url.com:5984/database-name","connection_timeout":"60000"}' -H "Content-Type: application/json" 我得到一个超时。 {"error":"timeout"} 如果我打开查尔斯(一个HTTP代理)并添加“代理”:“ http:// localhost:8888 ”curl请求有效载荷,没有stream量出现,所以我假设连接甚至从来没有尝试之间的本地沙发和远程沙发。 任何想法,为什么这是? 编辑 请注意,curl复制是在docker容器的shell中执行的。 我能够从同一个容器在本地和远程数据库上都创build新的数据库,只有复制超时。 编辑2经过一些试验和错误,我得到的复制运行,但它只复制一个文件的子集: 运行复制后的响应cURL: {"ok":true,"session_id":"3c195aa3c723696bfb33679d4de3632a","source_last_seq":79,"replication_id_version":3,"history":[{"session_id":"3c195aa3c723696bfb33679d4de3632a","start_time":"Mon, 20 Apr 2015 13:42:37 GMT","end_time":"Mon, 20 Apr 2015 13:42:38 GMT","start_last_seq":0,"end_last_seq":79,"recorded_seq":79,"missing_checked":53,"missing_found":53,"docs_read":53,"docs_written":**53**,"doc_write_failures":0}]} 目标数据库是一个空的数据库,所以它应该复制所有文件。 顺便说一句,这是本地原始数据库中cURL的结果: {"db_name":"db-name","doc_count":**435**,"doc_del_count":0,"update_seq":43116,"purge_seq":0,"compact_running":false,"disk_size":384835704,"data_size":7091262,"instance_start_time":"1429537029129810","disk_format_version":6,"committed_update_seq":43116} 所以它应该复制435个文件而不是53个。 我想如果我再次运行复制它会继续进程,但它没有运行(no_changes:true): {"ok":true,"no_changes":true,"session_id":"3c195aa3c723696bfb33679d4de3632a","source_last_seq":79,"replication_id_version":3,"history":[{"session_id":"3c195aa3c723696bfb33679d4de3632a","start_time":"Mon, 20 Apr 2015 13:42:37 GMT","end_time":"Mon, 20 Apr 2015 […]

HTTP / 2 nginx强制redirectHTTP到HTTPS打破预期的行为

我已经设置了一个使用支持HTTP / 2的最新版本的nginx的示例项目。 我正在closures这个官方博客文章: https : //www.nginx.com/blog/nginx-1-9-5/ 下面是一个工作代码示例(详细介绍如何在README中设置所有内容 – 下面粘贴了nginx.conf ): https : //github.com/Integralist/Docker-Examples/tree/master/Nginx-HTTP2 user nobody nogroup; worker_processes auto; events { worker_connections 512; } http { upstream app { server app:4567; } server { listen *:80 http2; location /app/ { return 301 https://$host$request_uri; } } server { listen *:443 ssl http2; server_name integralist.com; ssl_certificate /etc/nginx/certs/server.crt; […]

无法拉在redhat 7.1上的任何docker图像

我卡在这里 – 每当我试图拉任何图像时,我得到这个错误 – [xxxxx @ xxxxx〜] $ sudo docker pull busybox 使用默认标记:最新试图拉取存储库registry.access.redhat.com/busybox …失败试图拉仓库docker.io/library/busybox …失败拉图像时的错误:Get https://index.docker .io / v1 / repositories / library / busybox / images :dial tcp:lookup index.docker.io:没有与主机名关联的地址 从我能得到的错误是,服务器机器没有连接到互联网,但它是curl工作正常,我甚至已经下载包之前。 PS – sudodocker版本,sudodocker信息按预期工作我也configuration了cntlm并安装了组织的证书还有什么方法知道证书和cntlm是否正常工作请帮助。