docker-compose

CAT 监控搭建

≯℡__Kan透↙ 提交于 2019-12-09 14:47:46
简介 CAT 是基于 Java 开发的实时应用监控平台,为美团点评提供了全面的实时监控告警服务。 已经在美团点评的基础架构中间件框架(MVC框架,RPC框架,数据库框架,缓存框架等,消息队列,配置系统等)深度集成,为美团点评各业务线提供系统丰富的性能指标、健康状况、实时告警等。 开源地址:https://github.com/dianping/cat/ Docker 部署CAT 一、环境 已安装服务 服务1:docker-compose Version 1.25.0-rc2 服务2:Docker Version: 19.03.4 服务3:Mysql 5.7 服务4:git 1.8.3.1 二、通过Docker安装 1、创建CAT目录、进入到该目录下 mkdir -p /opt/cat/ cd /opt/cat 2、下载cat git clone https://github.com/dianping/cat.git 3、进入到Docker目录 /cat/docker 4、创建Dockerfile文件 vim Dockerfile FROM centos:centos6 USER root #UTILITIES RUN yum install -y wget RUN yum install -y tar #JAVA (OPENJDK 7) ENV JAVA_VERSION 1.7.0

How to pass environment variable to docker-compose up

允我心安 提交于 2019-12-09 14:03:34
问题 I am trying to run a container. I already have the image uploaded to private Docker registry. I want to write a compose file to download and deploy the image. But I want to pass the TAG name as a variable from the docker-compose run command.My compose file looks like below. How can I pass the value for KB_DB_TAG_VERSION as part of docker-compose up command? version: '3' services: db: #build: k-db user: "1000:50" volumes: - /data/mysql:/var/lib/mysql container_name: k-db environment: - MYSQL

docker-compose scale with sticky sessions

断了今生、忘了曾经 提交于 2019-12-09 13:38:01
问题 I have a webserver that requires websocket connection in production. I deploy it using docker-compose with nginx as proxy. So my compose file look like this: version: '2' services: app: restart: always nginx: restart: always ports: - "80:80" Now if I scale "app" service to multiple instances, docker-compose will perform round robin on each call to the internal dns "app". Is there a way to tell docker-compose load balancer to apply sticky sessions? Another solution - is there a way to solve it

How to connect Docker web app container to Docker PostgreSQL container?

假装没事ソ 提交于 2019-12-09 13:23:14
问题 I'm practicing making a Golang web app that interacts with a PostgreSQL database, each running on their own container. I'm running the containers with docker-compose up But I seem to be failing on getting the postgres container properly set up. For brevity, links to Dockerfile s and other settings files are on this gist (let me know if you want it here instead). version: '2' services: web_app: build: dockerfiles/web_app ports: - "9000:9000" volumes: - .:/go/src/gitlab.com/repo/web_app # links

How do I deploy my docker-compose project using Terraform?

北慕城南 提交于 2019-12-09 10:23:56
问题 I've looked all over and can't find a coherent resource that describes how to do this straightforwardly. I have a project like so: ./ |-src/ |--.. |--Dockerfile |-docker-compose.yaml A terraform config file like this: variable "do_token" {} # Configure the DigitalOcean Provider provider "digitalocean" { token = "${var.do_token}" } # Create a web server resource "digitalocean_droplet" "web" { # ... } I want to be able to do something like provider "digitalocean" { ip = <my-ip> # docker-compose

Docker Compose stuck downloading or pulling fs layer

丶灬走出姿态 提交于 2019-12-09 08:48:09
问题 I have the latest Docker for Mac installed, and I'm running into a problem where it appears that docker-compose up is stuck in a Downloading state for one of the containers: ± |master ✗| → docker-compose up --build Pulling container (repo.io/company/container:prod)... prod: Pulling from company/container somehash: Already exists somehash: Already exists somehash: Already exists somehash: Already exists somehash: Pulling fs layer somehash: Already exists somehash: Already exists somehash:

Gitlab CI runner not able to expose ports of nested Docker containers

╄→尐↘猪︶ㄣ 提交于 2019-12-09 07:48:05
问题 When using GitLab CI, as well as the gitlab-ci-multi-runner , I'm unable to get internally-started Docker containers to expose their ports to the "host", which is the Docker image in which the build is running. My .gitlab-ci.yml file: test: image: docker stage: test services: - docker:dind script: - APP_CONTAINER_ID=`docker run -d --privileged -p "9143:9143" appropriate/nc nc -l 9143` - netstat -a - docker exec $APP_CONTAINER_ID netstat -a - nc -v localhost 9143 My command: gitlab-ci-multi

How do i pass an argument along with docker-compose up

丶灬走出姿态 提交于 2019-12-09 05:21:57
问题 I have a docker-compose.yml file and in the terminal I am typing docker-compose up [something] but I would also like to pass an argument to docker-compose.yml . Is this possible? I've read about interpolation variables and tried to specify a variable in the .yml file using ${testval} and then docker-compose up [something] var="test" but I receive the following error: WARNING: The testval variable is not set. Defaulting to a blank string. ERROR: No such service: testval=test 回答1: Based on

How to connect to a Redis container using Docker Compose?

我只是一个虾纸丫 提交于 2019-12-09 05:17:03
问题 This docker-compose.yml seems to work OK: version: '3' services: web: image: web-app command: bundle exec rackup ports: - "9292:9292" links: - redis redis: image: redis Command: docker build -t web-app .; docker-compose up The Web App is expecting a REDIS_URL config. Web App Dockerfile: ENV REDIS_URL redis:6379 It seems that the Web App cannot connect to the Redis: Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED): So, what is the Redis URL for the

Docker error: invalid reference format: repository name must be lowercase

我的梦境 提交于 2019-12-09 05:02:35
问题 Ran into this Docker error with one of my projects: invalid reference format: repository name must be lowercase What are the various causes for this generic message? I already figured it out after some effort, so I'm going to answer my own question in order to document it here as the solution doesn't come up right away when doing a web search and also because this error message doesn't describe the direct problem Docker encounters. 回答1: A "reference" in docker is a pointer to an image. It may