Tag: compose

与docker工人的Odoo例子组成没有工作

这是官方的Odoo文件docker-compose例子: version: '2' services: web: image: odoo:10.0 depends_on: – db ports: – "8069:8069" volumes: – odoo-web-data:/var/lib/odoo – ./config:/etc/odoo – ./addons:/mnt/extra-addons db: image: postgres:9.4 environment: – POSTGRES_PASSWORD=odoo – POSTGRES_USER=odoo – PGDATA=/var/lib/postgresql/data/pgdata volumes: – odoo-db-data:/var/lib/postgresql/data/pgdata volumes: odoo-web-data: odoo-db-data: 当我运行“docker-compose up -d”输出下一个错误: ERROR: for test2_db_1 Cannot start service db: failed to create endpoint test2_db_1 on network test2_default: failed […]

Jenkins的Dockerfile

我在Docker和Jenkins中是全新的,我想试着问你,也许你能帮助我。 我想创build一个所有必要的Jenkins部件的Dockerfile,以便能够创build一个自动化的任务来检出github。 所以首先我在github上find了公共dockerfile( https://github.com/jenkinsci/docker/blob/master/Dockerfile ),但是它包含了很多参数,我不确定是否必须使用整个Dockerfile。 首先,你可以给我一个build议,如何修改dockerfile? 或者build议使用原始的Dockerfile(URL是上面的)? 谢谢你的build议,伙计们,祝你有美好的一天。

docker nginx无法与web容器build立连接

我的dockernginx容器未能连接到gunicorn容器。 docker工作日志看起来像, dj | [2017-09-16 12:37:14 +0000] [22] [INFO] Starting gunicorn 19.7.1 dj | [2017-09-16 12:37:14 +0000] [22] [DEBUG] Arbiter booted dj | [2017-09-16 12:37:14 +0000] [22] [INFO] Listening at: http://127.0.0.1:8000 (22) dj | [2017-09-16 12:37:14 +0000] [22] [INFO] Using worker: sync dj | [2017-09-16 12:37:14 +0000] [25] [INFO] Booting worker with pid: 25 dj […]

音量坐骑不适用于数字海洋

小testing案例: 泊坞窗,compose.yml nginx: image: nginx:1 ports: – "80:80" volumes: – ./testconf:/etc/nginx/conf.d – ./testhtml:/usr/share/nginx/html testconf / nginx.conf server { listen 80; server_name _; location / { root /usr/share/nginx/html; try_files $uri $uri/; } } testhtml / index.html的 <!DOCTYPE html> <html> <body> <p>Hello</p> </body> </html> 机器创造: $ docker-machine create –driver digitalocean –digitalocean-access-token xxxx –digitalocean-region "ams3" edgee 推动: $ […]

系统日志驱动程序不能与泊坞窗撰写和麋鹿栈

我想从一个运行my_service容器发送日志到另一个运行带有syslog驱动程序的ELK栈(所以我需要安装logstash-input-syslog插件)。 我正在调整这个麋鹿图像 (并标记为elk-custom )通过下面的Dockerfile-elk (使用端口514因为这似乎是默认的端口 ) FROM sebp/elk WORKDIR /opt/logstash/bin RUN ./logstash-plugin install logstash-input-syslog EXPOSE 514 通过docker-compose运行我的服务如下或多或less: elk-custom: # image: elk-custom build: context: . dockerfile: Dockerfile-elk ports: – 5601:5601 – 9200:9200 – 5044:5044 – 514:514 my_service: image: some_image_from_my_local_registry depends_on: – elk-custom logging: driver: syslog options: syslog-address: "tcp://elk-custom:514" 然而: 错误:对于b4cd17dc1142_namespace_my_service_1无法启动服务my_service:未能初始化logging驱动程序:拨号tcp:查找elk-custom在10.14.1.31:53:服务器行为不当 错误:api无法启动服务my_service:无法初始化日志logging驱动程序:拨号tcp:查找elk-custom上10.14.1.31:53:服务器行为exception错误:遇到错误,同时提出项目。 有什么build议么? 更新 :显然没有任何东西似乎是监听端口514 ,从容器内的原因,命令netstat -a显示此端口上没有任何东西….不知道为什么…

区分多个系统日志docker源代码

我正在build立一个docker-compose与几个服务,所有这些都写入到一个通用的syslog容器/服务…实际上是一个logstash服务(一个完整的elk图像事实上)与logstash-input-syslog插件启用.. 种类如下(使用自定义5151端口,因为默认514由于权限问题给我一个困难): 服务: elk-custom: image: some_elk_image ports: – 5601:5601 – 9200:9200 – 5044:5044 – 5151:5151 service1: image: myservice1_image logging: driver: syslog options: syslog-address: "tcp://127.0.0.1:5151" service2: image: myservice2_image logging: driver: syslog options: syslog-address: "tcp://127.0.0.1:5151" 我的问题是如何添加一个字段(一个option而不是在logging下),这样logstash中的每个日志条目最后都有一个字段,其值有助于确定日志是来自service1还是service2 。 我有种设法使用tag字段来做到这一点,但信息最终成为消息的一部分,而不是一个单独的字段,我可以在elasticsearch用于查询。 目前, kibana显示日志条目如下: @timestamp:September 26th 2017,12:00:47.684 syslog_severity_code:5 port:53,422 syslog_facility:user-level @version:1 host:172.18.0.1 syslog_facility_code:1 message:<27> Sep 26 12:00:47 7705a2f9b22a [2128 ]:[pid:94 | […]

dockerfile安装去本地包可以吗?

我正在尝试用我的golang项目创build一个docker镜像。 该项目有一些像math一样的本地包: /myproject/ src/ main.go utils/ math.go 在main.go中,我包含了大量的包,但也包括math.go的 math 。 我的docker文件看起来像这样: FROM golang:latest ENV GOPATH=/golib/ RUN /usr/local/go/bin/go get github.com/julienschmidt/httprouter CMD /usr/local/go/bin/go run main.go EXPOSE 10004 我如何包括math包,因为它是一个本地包,所以它不在github上部署? yml文件: services: cozonac: image: cozonac:local ports: – "10004:10004" volumes: – ./src/:/go/ 谢谢

Dockerizing Node.js应用程序

当试图dockerize节点的应用程序,当我访问本地主机:8000我得到这个错误: 连接被重置 – 连接到服务器被重置,而页面加载。 在terminal上,当我在图像上使用运行命令时,我在控制台中得到所需的输出。 它说: 运行在http:// localhost:8000 / Dockerfile: FROM node RUN mkdir -p /app/ WORKDIR /app COPY package.json /app RUN cd /app RUN npm install COPY . /app CMD ["node", "index.js"] EXPOSE 8000 index.js: #!/usr/bin/env nodejs var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(8000, 'localhost'); console.log('Server […]

未find文件 – Docker中的Nginx

描述 我有一个docker容器与此 nginx.conf server { listen 80; index index.php index.html; root /var/www/public; location / { try_files $uri /index.php?$args; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass app:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } 泊坞窗,compose.yaml version: '2' services: # The Application app: build: context: ./ dockerfile: app.dockerfile working_dir: /var/www volumes: […]

Docker环境variables在多阶段构build中

给这个.env文件: TEST=33333 给这个docker-compose.yml文件: service_name: image: test env_file: .env environment: TEST: 22222 给这个Dockerfile文件: FROM an_image AS builder FROM another_image ENV TEST 11111 CMD ["/bin/echo $TEST"] 每当我在一个容器中构build并运行这个图像,它就会打印11111 。 如果我从Dockerfile中删除ENV 11111行,我的TEST环境variables是空的… 父图像是否接收环境variables而不是子图像? 谢谢! 编辑: 尝试ENV TEST ${TEST}没有工作($ TEST是空的) 删除ENV TEST没有工作($ TEST是空的)