docker-compose

Docker Compose how to extend service with build to use an image instead

淺唱寂寞╮ 提交于 2019-12-22 06:34:18
问题 Having a base docker-compose.yml like the following: version: '2' services: web: build: . ... How can I extend it to use an image instead? docker-compose.prod.yml version: '2' services: web: image: username/repo:tag Running it with docker docker-compose -f docker-compose.yml -f docker-compose.prod.yml up still promps: Building web Step 1/x : FROM ... I tried with docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --no-build : ERROR: Service 'web' needs to be built, but --no

Ubuntu16.04下安装Docker与docker-compose

风格不统一 提交于 2019-12-22 05:49:06
什么是Docker Docker 是一个开源的应用容器引擎,基于 Go语言 并遵从 Apache2.0 协议开源 Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级,可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化 容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app),更重要的是容器性能开销极低 Docker的应用场景 Web 应用的自动化打包和发布。 自动化测试和持续集成、发布。 在服务型环境中部署和调整数据库或其他的后台应用。 从头编译或者扩展现有的 OpenShift 或 Cloud Foundry 平台来搭建自己的 PaaS 环境 Docker的优点 Docker 是一个用于开发,交付和运行应用程序的开放平台借助 Docker,您可以与管理应用程序相同的方式来管理基础架构。通过利用 Docker 的方法来快速交付,测试和部署代码,您可以大大减少编写代码和在生产环境中运行代码之间的延迟 Docker的基本概念 1. 镜像 操作系统分为内核和用户空间。对于 Linux 而言,内核启动后,会挂载 root 文件系统为其提供用户空间支持。而Docker镜像 (Image),就相当于是一个 root 文件系统。Docker 镜像是一个特殊的文件系统,除了提供容器运行时所需的程序、库、资 源、配置等文件外

Docker “Gracefully stopping” itself during `docker-compose up` but not `docker-compose run --entrypoint`

百般思念 提交于 2019-12-22 05:18:13
问题 When I start a Docker container with docker-compose up , it starts up as usual, but eventually the container automatically exits without anything that I can tell is useful in the verbose log. When I instead run docker-compose up --entrypoint run-tests.sh with the same docker-compose.yml configuration (with the same entrypoint set) and the same Dockerfile, the Docker container says "Gracefully stopping" on its own and stops all containers. The bad behaviour seems to come from running docker

Changing default subnet for docker custom networks

不羁的心 提交于 2019-12-22 05:12:03
问题 Our internal network has the range 172.20.0.0/16 reserved for internal purposes and docker uses the 172 range by default for its internal networking. I can reset the bridge to live in 192.168 by providing the bip setting to the daemon: ➜ ~ sudo cat /etc/docker/daemon.json { "bip": "192.168.2.1/24" } ➜ ~ ifconfig docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.2.1 netmask 255.255.255.0 broadcast 0.0.0.0 However, when creating new custom networks via docker network create or

Docker Login: Error when manually logging into private Registry

心已入冬 提交于 2019-12-22 05:11:41
问题 I can't manually log into my private GitLab Docker Registry from CLI: # docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" "${DOCKER_URL}" error getting credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY` System info: Ubuntu 18.04 docker-ce 18.03.1~ce~3-0~ubuntu (from official repo, without install script) There is no ~/.docker/config.json for any users and I'm executing the docker login as root. On Google, I just find recommendations to export DISPLAY ...

How to change the service name generated by Docker stack in docker-compose

给你一囗甜甜゛ 提交于 2019-12-22 04:38:15
问题 When deploying a stack of this compose file using: docker stack deploy -c docker-compose.yml myapp service-name: image: service-image namelike-property: my-custom-service-name // here I would like to know the property The generated service name will be myapp_service-name I would want it to be named and referenced by my-custom-service-name 回答1: For communication between services you can use the serviceName as defined in the compose file (in your case your service name is service-name) if both

AWS Cloudwatch logs with Docker Container - NoCredentialProviders: no valid providers in chain

无人久伴 提交于 2019-12-22 04:34:13
问题 My docker-compose file: version: '2' services: scraper: build: ./Scraper/ logging: driver: "awslogs" options: awslogs-region: "eu-west-1" awslogs-group: "doctors-logs" awslogs-stream: "scrapers-stream" volumes: - ./Scraper/spiders:/spiders I have added my AWS credentials to my mac using the aws configure command and the credentials are stored correctly in ~/.aws/credentials When I run docker-compose up I get the following error: ERROR: for scraper Cannot start service scraper: Failed to

Yahoo manager error using Docker Ask timed out on [ActorSelection[Anchor(akka://kafka-manager-system/),

旧时模样 提交于 2019-12-22 04:14:17
问题 In order to replicate this issue run docker run zookeeper then docker-compose up on the below yaml file. I am using zookeeper latest image, wurstmeister/kafka:0.9.0.0-1 and sheepkiller/kafka-manager:latest. I ran docker-compose up and finallzy got it working but now I get the following error: I have searched git and stack over flow with no avail. Everything looks fine until I save a cluster. In the Kafka logs I get: [warn] o.a.z.ClientCnxn - Session 0x0 for server null, unexpected error,

Connect to another container using Docker compose

纵饮孤独 提交于 2019-12-22 04:00:46
问题 I would need to use two containers together: one with Tomcat and another with a Database. I have created the following yaml file which describes the services: postgredb: image: postgres expose: - 5432 ports: - 5432:5432 environment: - POSTGRES_USER=user - POSTGRES_PASSWORD=password tomcat: image: tomcat links: - postgredb:db ports: - 8080:8080 Once started docker-compose I can see that I'm not able to reach the Database from Tomcat, unless I retrieve the IP address of the Database (via docker

Limit useable host resources in Docker compose without swarm

房东的猫 提交于 2019-12-22 01:42:35
问题 I simply want to limit the resources of some Docker containers in a docker-compose file. The reason is simple: There are multiple apps/services running on the host. So I want to avoid, that a single container can use e.g. all memory, which harms the other containers. From the docs I learned, that this can be done using resources . But this is beyond deploy . So I have to write my docker-compose file like the following example: php: image: php:7-fpm restart: always volumes: - ./www:/www deploy