docker-swarm

How to specify an iterator in the volume path when using docker-compose to scale up service?

蹲街弑〆低调 提交于 2019-12-20 19:45:01
问题 Background: I'm using docker-compose in order to place a tomcat service into a docker swarm cluster but I'm presently struggling with how I would approach the logging directory given that I want to scale the service up yet retain the uniqueness of the logging directory. Consider the (obviously) made up docker-compose which simply starts tomcat and mounts a logging filesystem in which to capture the logs. version: '2' services: tomcat: image: "tomcat:latest" hostname: tomcat-example command:

Docker-compose: deploying service in multiple hosts

我的未来我决定 提交于 2019-12-20 08:53:31
问题 I have a docker-compose file that deploys 8 different docker services in the same host. Is it possible to deploy it in different hosts?, I would like to deploy some service in one hosts and another ones in other host remotelly. Would I need to use docker-swarm? or is an easier way to do? I have read that it could be done using DOCKER_HOST, but if I configure /etc/default/docker with this variable, all the services would be run on the remote host, and what I need is some services in one remote

Docker Containers can not be stopped or removed - permission denied Error

。_饼干妹妹 提交于 2019-12-20 08:37:32
问题 Issue : Can not stop docker containers, whenever I try to stop containers I get the following Error message, ERROR: for yattyadocker_web_1 cannot stop container: 1f04148910c5bac38983e6beb3f6da4c8be3f46ceeccdc8d7de0da9d2d76edd8: Cannot kill container 1f04148910c5bac38983e6beb3f6da4c8be3f46ceeccdc8d7de0da9d2d76edd8: rpc error: code = PermissionDenied desc = permission denied OS Version/build: Ubuntu 16.04 | Docker Version 17.09.0-ce, build afdb6d4 | Docker Compose version 1.17.1, build 6d101fb

What is the different between putting a separate service discovery and integrate it into the cluster machine in Docker Swarm

巧了我就是萌 提交于 2019-12-19 11:19:34
问题 I am having problem understanding the need of a separated service discovery server while we could register the slave node to the master node at the slave node start-up through whatever protocol. Hosting another service seem redundant to me. 回答1: Docker Swarm is there to create a cluster of hosts running Docker and schedule containers across the cluster. It does not include service discovery, which is provided by a backend service, such as etcd, consul or zookeeper. The first problem: service

nodejs app doesn't connect to localhost when running within a docker container

浪尽此生 提交于 2019-12-17 20:42:26
问题 My environment: Ubunut 17.04 LTS npm --version: 5.6.0 nodejs --version: 4.7.2 angular cli version: 1.6.4 docker-compose file: version: '3' services: my-app: build: context: . dockerfile: Dockerfile restart: unless-stopped volumes: - .:/usr/src/app ports: - "4200:4200" I commented out the EXPOSE 4200 in dockerfile because I'm already mounting it from docker-compose.yml file, is that NOT ok, should I expose in dockerfile and mount in docker-compose? Running npm start on command line launches

Docker Deploy stack extra hosts ignored

孤人 提交于 2019-12-14 03:07:14
问题 docker stack deploy isnt respecting the extra_hosts parameter in my compose file. when i do a simple docker-compose up the entry is created in the /etc/hosts however when i do docker deploy –compose-file docker-compose.yml myapp it ignores extra_hosts, any insights? Below is the docker-compose.xml: version: '3' services: web: image: user-service deploy: labels: - the label build: context: ./ environment: DATABASE_URL: jdbc:postgresql://dbhost:5432/postgres ports: - 9002:9002 extra_hosts: -

What is the difference between docker host and node?

十年热恋 提交于 2019-12-14 02:58:39
问题 I know that questions similar to this one is already asked on SO. But, it doesn't make clarification on what I am looking for. I am trying to get my hands dirty on docker. I have encountered the terminology docker host and docker node . I am referring this article:- https://docs.docker.com/get-started/part3/#docker-composeyml. I know that docker host is the one, which runs one or more containers and in which docker engine is installed. Moreover, docker host can either be a physical machine or

Cannot leave swarm mode

醉酒当歌 提交于 2019-12-13 17:08:17
问题 I've been tinkering with new Docker swarm mode. I can't fully recall the steps that I did, but now I'm stuck in situation where my docker engine is as a worker in a non-existing swarm: $ docker info ... Swarm: active NodeID: 1vndsuqa0r3paswufs7eq4po3 Is Manager: false Node Address: 192.168.65.2 ... $ docker swarm leave Error response from daemon: context deadline exceeded $ docker version Client: Version: 1.12.0 API version: 1.24 Go version: go1.6.3 Git commit: 8eab29e Built: Thu Jul 28 21:04

Do I need to create multi host network in docker?

一个人想着一个人 提交于 2019-12-13 11:05:07
问题 For the below docker-compose building docker file dynamically: version: '2' volumes: jenkins_home: external: true services: jenkins: build: context: . args: DOCKER_GID: ${DOCKER_GID} DOCKER_ENGINE: ${DOCKER_ENGINE} DOCKER_COMPOSE: ${DOCKER_COMPOSE} volumes: - jenkins_home:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock ports: - "8080:8080" creates bridge type network ( project1_default ) is created: $ docker network ls NETWORK ID NAME DRIVER SCOPE .... f1b7ca7c6dfe project1

Initiate MongoDB replica set in docker swarm

依然范特西╮ 提交于 2019-12-13 04:19:11
问题 I have created two config servers with replica set name rs0 in docker-compose.yml file deployed as sudo docker stack deploy --with-registry-auth --compose-file docker-compose.yml test . version: "3.3" services: cfg1-r1: image: mongo:3.2 deploy: placement: constraints: [node.hostname == ram-ThinkPad-E470] restart_policy: condition: on-failure volumes: - /opt/mongoshard/tmp:/var/lib/mongodb - /opt/mongoshard/mongod.conf:/etc/mongod.conf networks: - mongoshard command: ["mongod", "--configsvr",