docker-compose

mount files present in a directory in docker image with the directory in the host

那年仲夏 提交于 2020-01-24 19:37:07
问题 I have a docker image in which there are few configuration files present in the directory /opt/app/config now i wanted to mount this directory to a host directory so that config files can be accessed from host. my docker compose is a follows web: image: web:v1 container_name: web volumes: - ./config:/opt/app/config command: ["tail","-f","/dev/null"] ports: - 5000:5000 if i run the individual web image using docker run -it web:v1 bash and do ls /opt/app/config i can see the config files but

Docker-compose: How to share data between services without using named volumes or multi-stage builds

廉价感情. 提交于 2020-01-24 19:31:08
问题 Are there any ways to share data between containers. There is following docker-compose file version: '3' services: app_build_prod: container_name: 'app' build: context: ../ dockerfile: docker/Dockerfile args: command: build:prod nginx: container_name: 'nginx' image: nginx:alpine ports: - "80:80" depends_on: - app_build_prod Dockerfile content is: FROM node:10-alpine as builder ## Installing missing packages, fixing git self signed certificate issue RUN apk update && apk upgrade && \ apk add -

Mounting a single file from an NFS docker volume into a container

痴心易碎 提交于 2020-01-24 19:30:29
问题 Example (many options omitted for brevity): version: "3" volumes: traefik: driver: local driver_opts: type: nfs o: "addr=192.168.1.100,soft,rw,nfsvers=4,async" device: ":/volume/docker/traefik" services: traefik: volumes: - traefik/traefik.toml:/traefik.toml This errors out as there is no volume with the name traefik/traefik.toml meaning that the volume name must be the full path to the file (i.e. you can't append a path to the volume name)? Trying to set device: ":/volume/docker/traefik

java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3

♀尐吖头ヾ 提交于 2020-01-24 13:18:16
问题 i am trying to run the following vertx tutorial but stuck on this exception. http://www.sczyh30.com/vertx-blueprint-microservice/index.html i have tried to run just single service or the whole project the exception is coming the same. any docker setting i am missing? ov 03, 2016 10:35:55 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer cache-infrastructure_1 | INFO: Succeeded in deploying verticle inventory-microservice_1 | java.net.UnknownHostException: failed to resolve

java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3

眉间皱痕 提交于 2020-01-24 13:15:14
问题 i am trying to run the following vertx tutorial but stuck on this exception. http://www.sczyh30.com/vertx-blueprint-microservice/index.html i have tried to run just single service or the whole project the exception is coming the same. any docker setting i am missing? ov 03, 2016 10:35:55 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer cache-infrastructure_1 | INFO: Succeeded in deploying verticle inventory-microservice_1 | java.net.UnknownHostException: failed to resolve

npm can't find package.json when running docker container with compose

懵懂的女人 提交于 2020-01-24 10:59:08
问题 I am trying to wire up my Angular 7 client app into docker compose locally. I get the following error when I docker-compose up: client-app | npm ERR! errno -2 client-app | npm ERR! syscall open client-app | npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json' Dockerfile: FROM node:9.6.1 RUN mkdir -p /app WORKDIR /app EXPOSE 4200 ENV PATH /app/node_modules/.bin:$PATH COPY . /app RUN npm install --silent RUN npm rebuild node-sass CMD ["npm", "run", "docker-start"] The

Multiple databases in docker and docker-compose

烂漫一生 提交于 2020-01-24 02:59:06
问题 I have a project consisting of two main java apps that use eight postgres databases, so is there a way in docker-compose to build eight different databases so that each one has a different owner and password? Can I even do that in docker-compose? example : services: postgresql: build: db/. ports: - "5432:5432" environment: - POSTGRES_DB=database1 - POSTGRES_USER=database1 - POSTGRES_PASSWORD=database1 I know I can put all the .sql files in the docker-entrypoint-initdb.d and postgres will make

gitlab-ci.yml & docker-in-docker (dind) & curl returns connection refused on shared runner

坚强是说给别人听的谎言 提交于 2020-01-23 22:09:29
问题 I'm trying to create a simple GitLab CI where I spin up a container using docker-compose up then try to access it using curl and finally tear it down using docker-compose down. docker-compose up spins up perfectly fine and I can see the container up using docker ps -a, however when I curl, I get "connection refused". here is my gitlab-ci.yml image: docker services: - docker:dind before_script: - apk add --update python py-pip python-dev && pip install docker-compose - apk add --update curl &&

gitlab-ci.yml & docker-in-docker (dind) & curl returns connection refused on shared runner

荒凉一梦 提交于 2020-01-23 22:08:28
问题 I'm trying to create a simple GitLab CI where I spin up a container using docker-compose up then try to access it using curl and finally tear it down using docker-compose down. docker-compose up spins up perfectly fine and I can see the container up using docker ps -a, however when I curl, I get "connection refused". here is my gitlab-ci.yml image: docker services: - docker:dind before_script: - apk add --update python py-pip python-dev && pip install docker-compose - apk add --update curl &&

docker-compose MongoDB Error: network error while attempting to run command 'isMaster' on host

不想你离开。 提交于 2020-01-23 22:07:05
问题 I`m trying to connect to mongodb in docker container from outside with mongo, but I get the following error. MongoDB shell version v3.6.5 connecting to: mongodb://127.0.0.1:27017 2018-05-30T14:54:13.950+0200 E QUERY [thread1] Error: network error while attempting to run command 'isMaster' on host '127.0.0.1:27017' : connect@src/mongo/shell/mongo.js:251:13 @(connect):1:6 exception: connect failed When I bash into the Container everything is fine. It was working maybe half a year ago but now it