docker-compose

How to let different Docker containers talk to each other without exposing the ports to the whole world

一个人想着一个人 提交于 2019-12-19 10:47:50
问题 I needed to test my kafka consumer and message triggers in a controlled environment. So I made an ansible project for creating some mock kafka servers: mokafelk. It works fine except the security is shit. The playbook spins up a 3-node dockerized kafka cluster by default but the listening ports on the kafka servers are exposed to all. Here's the jinja2 template of the Dockerfile used for creating the cluster. Basically I want the containers to be able to talk to each other. I don't think

Unable to copy file from docker-compose mount to host

时间秒杀一切 提交于 2019-12-19 08:30:52
问题 I am unable to copy a file generated by my Selenium tests in a folder inside docker container mounted to host machine. Here is how my compose file look like selenium: image: 'selenium/standalone-chrome' expose: - "4444" tests: build: context: ./tests dockerfile: Dockerfile depends_on: - selenium - web volumes: - /testResultsReport:/testResultsReport This is how my directory structure looks like. \ - docker-compose.yml - build scripts - tests - testResultsReport - Test scripts Name of the file

Kafka partitions have leader brokers without a matching listener

五迷三道 提交于 2019-12-19 05:28:32
问题 I'm trying to get Kafka to work on docker-compose for the first time. The application runs fine without docker. But on docker, I get the error as described below. Any reason why Kafka would throw this error? The error: email-service_1 | 2018-12-01 14:32:02.448 WARN 1 --- [ntainer#0-0-C-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-2, groupId=kafka] 1 partitions have leader brokers without a matching listener, including [email-token-0] My docker-compose config: version: '3.3' services

`data-container` with named or anonymous volumes - conceptual problems? (Discussion)

▼魔方 西西 提交于 2019-12-19 04:55:35
问题 a) Anonymous volumes When using data-containers, you can either use anonymous volumes like this version '2' services: consumer: volume_from: - data-container:rw data-container: image: cogniteev/echo command: echo 'Data Container' volume: - /var/www b) Name volumes or you can use named volumes like this version '2' services: consumer: volume_from: - data-container:rw data-container: image: cogniteev/echo command: echo 'Data Container' volume: - my-named-volume:/var/www volumes: my-named-volume

MySQL container failing to run initialisation scripts in Docker Compose

北城余情 提交于 2019-12-19 04:11:17
问题 I am having issues getting my MySQL container to run some initialisation scripts (creating some databases) from Docker Compose. As per the documentation on Docker Hub, I mount the .sql files in /docker-entrypoint-initdb.d but to no avail. My compose files is as follows: version: '2' services: database: image: mysql ports: - "3307:3306" environment: MYSQL_ROOT_PASSWORD: root volumes: - ./scripts/db:/docker-entrypoint-initdb.d myservice: image: company/myservice expose: - "10001" depends_on: -

Moving docker-compose containersets around between hosts

廉价感情. 提交于 2019-12-18 20:04:29
问题 I would like to take my application stack, consisting of 3 docker images and managed by docker-compose, and move it in its entirety from my development machine onto a production machine. I know of a few ways to do this with straight up docker: Push the images to the registry and pull them back out from production docker save from development and then docker load on production rebuild the images on production (would rather keep dependencies down on production, so not a good option.) I'm

docker-compose 搭建gitlab

早过忘川 提交于 2019-12-18 18:39:36
搭建步骤 1、安装docker及docker-compose 2、编写dokcer-compose文件 并且启动 version: '3.7' services: gitlab: container_name: mygitlab image: 'gitlab/gitlab-ce:11.9.6-ce.0' restart: always hostname: 'yujuan.com' environment: - TZ=Asia/Shanghai ports: - '3080:80' - '3443:443' - '3022:22' volumes: - ./config:/etc/gitlab - ./logs:/var/log/gitlab - ./data:/var/opt/gitlab network_mode: "bridge" privileged: true docker-compose up -d 3、访问localhost:3080 进入GitLab页面 localhost:3080 我们首次进入时,会让初始化管理员的密码,这里初始化完成后使用 root/初始化密码 进入gitlab页面(如下),按照对应的提示创建项目、创建用户、创建组即可 注意事项 权限问题 在构建镜像时,有时候会遇到权限不足导致gitlab启动失败的问题,如果遇到该错误,需要在docker

Wordpress on docker-compose no run

こ雲淡風輕ζ 提交于 2019-12-18 16:08:50
问题 This is my docker-compose.yml version: '2' services: wordpress: image: wordpress ports: - "8080:80" environment: WORDPRESS_DB_PASSWORD: example db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: example the services run normally, but, a few seconds later, the wordpress container stop. This is my docker logs wordpress container: WordPress not found in /var/www/html - copying now... Complete! WordPress has been successfully copied to /var/www/html MySQL Connection Error: (2002) php_network

Wordpress on docker-compose no run

大兔子大兔子 提交于 2019-12-18 16:08:11
问题 This is my docker-compose.yml version: '2' services: wordpress: image: wordpress ports: - "8080:80" environment: WORDPRESS_DB_PASSWORD: example db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: example the services run normally, but, a few seconds later, the wordpress container stop. This is my docker logs wordpress container: WordPress not found in /var/www/html - copying now... Complete! WordPress has been successfully copied to /var/www/html MySQL Connection Error: (2002) php_network

NGINX Reverse Proxy failing with Linked Docker Containers

允我心安 提交于 2019-12-18 15:57:11
问题 I have the following docker-compose.yml : node1: build: ./node links: - redis ports: - "8080" node2: build: ./node links: - redis ports: - "8080" service1: build: ./service links: - redis ports: - "8383" redis: image: redis ports: - "6379" nginx: build: ./nginx links: - node1:node1 - node2:node2 - service1:service1 ports: - "80:80" After executing this and running docker ps I get the following: 080d9d7dc2e0 dockerworkflow_nginx:latest "nginx -g 'daemon of 5 minutes ago Up 5 minutes 0.0.0.0:80