docker-compose

Fabric1.4:手动启动 first-network 网络(三)

人盡茶涼 提交于 2020-01-11 18:22:09
注意:本文所使用的 fabric 版本为 v1.4.3,与其它版本的网络存在差异。 手动启动 first-network 网络系列分为三部分: 手动启动 first-network 网络(一) 手动启动 first-network 网络(二) 手动启动 first-network 网络(三) 第一篇单纯使用命令行的形式执行 byfn.sh 脚本中的内容,第二篇和第三篇是对手动启动网络过程所使用的命令和配置文件的解释。 1 启动分布式网络 手动生成 fabric 网络所需的配置文件后,接下来需要启动区块链中提供网络服务的各个节点。fabric 采用容器技术,使用 docker-compose 这个工具来实现区块链网络所需的节点容器管理,实现方式只需要编写节点相应的配置文件即可。 1.1 docker-compose-cli.yaml 在 first-network 目录下提供了一个 dokcer-compose 工具所需的配置文件 docker-compose-cli.yaml,我们使用该文件启动网络节点,下面是该文件的内容: version: '2' # 表示用的版本 2 的 YAML 版本 volumes: orderer.example.com: peer0.org1.example.com: peer1.org1.example.com: peer0.org2.example

Docker-compose set user and group on mounted volume

依然范特西╮ 提交于 2020-01-11 15:26:18
问题 I'm trying to mount a volume in docker-compose to apache image. The problem is, that apache in my docker is run under www-data:www-data but the mounted directory is created under root:root . How can I specify the user of the mounted directory? I tried to run command setupApacheRights.sh . chown -R www-data:www-data /var/www but it says chown: changing ownership of '/var/www/somefile': Permission denied services: httpd: image: apache-image ports: - "80:80" volumes: - "./:/var/www/app" links: -

How to pass arguments to a Dockerfile?

流过昼夜 提交于 2020-01-11 15:04:40
问题 I am using RUN instruction within a Dockerfile to install a rpm RUN yum -y install samplerpm-2.3 However, I want to pass the value "2.3" as an argument. My RUN instruction should look something like: RUN yum -y install samplerpm-$arg where $arg=2.3 回答1: You are looking for --build-arg and the ARG instruction. These are new as of Docker 1.9. Check out https://docs.docker.com/engine/reference/builder/#arg. This will allow you to add ARG arg to the Dockerfile and then build with docker build -

Docker-compose depends on not waiting until depended on service isn't fully started

 ̄綄美尐妖づ 提交于 2020-01-11 13:21:16
问题 version: '3' services: server: container_name: hotel-server build: dockerfile: Dockerfiles/server/Dockerfile context: . environment: dbhost: db links: - db depends_on: - db restart: always ports: - "3456:3456" db: image: "custom-postgis:latest" container_name: hotelsdb environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: alliswell # POSTGRES_DB: hotels ports: - "5437:5432" volumes: - hoteldata:/var/lib/postgresql/data #persistence volumes: hoteldata: {} The way I've set up the custom

Docker-Compose not able to copy haproxy.cfg

假装没事ソ 提交于 2020-01-11 09:50:14
问题 My problem is that I have a docker-compose.yml file and an haproxy.cfg file and I want docker-compose to copy the haproxy.cfg file to the docker container. As per the post Docker composer copy files I can use volumes to do it but in my case I'm getting the below error. Can anybody help me achieve this. Below is the code and everything docker-compose.yml version: "3.3" services: ###After all services are up, we are initializing the gateway gateway: container_name: gateway-haproxy image:

Docker - PG::ConnectionBad

£可爱£侵袭症+ 提交于 2020-01-11 09:00:06
问题 Running Rails with Phusion Passenger, currently having trouble with postgres, whenever I run the build command I get this error: PG::ConnectionBad (could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? ): My Dockerfile FROM phusion/passenger-customizable MAINTAINER VodkaMD <support@nyvur.com> ENV RACK_ENV="production" RAILS_ENV="production" SECRET_KEY_BASE=

Volume binding using docker compose on Windows

一曲冷凌霜 提交于 2020-01-11 08:27:09
问题 I recently upgraded my Docker Toolbox on Windows 10, and now my volume mounts no longer work. I've tried everything. Here is the current mount path: volumes: - C:\Users\Joey\Desktop\backend:/var/www/html I receive an invalid bind mount error. 回答1: I think you have to set COMPOSE_CONVERT_WINDOWS_PATHS=1 , see here. Docker Machine should do it automatically: https://github.com/docker/machine/pull/3830 回答2: I faced with same issue (I'm using Docker Desktop). My steps were: 1) Place your folder

docker-compose : The server requested authentication method unknown to the client

前提是你 提交于 2020-01-10 18:47:08
问题 I have this yml file for configuration of MySQL in docker: # Use root/example as user/password credentials version: '3.1' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: 'pass' MYSQL_DATABASE: 'db' MYSQL_USER: 'user' MYSQL_PASSWORD: 'pass' adminer: image: adminer restart: always ports: - 8888:8080 And I start the container using following command from the same directory where yml is located: docker-compose -f stack.yml up Then I got this error: 回答1: This worked

docker-compose : The server requested authentication method unknown to the client

混江龙づ霸主 提交于 2020-01-10 18:46:05
问题 I have this yml file for configuration of MySQL in docker: # Use root/example as user/password credentials version: '3.1' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: 'pass' MYSQL_DATABASE: 'db' MYSQL_USER: 'user' MYSQL_PASSWORD: 'pass' adminer: image: adminer restart: always ports: - 8888:8080 And I start the container using following command from the same directory where yml is located: docker-compose -f stack.yml up Then I got this error: 回答1: This worked

docker-compose使用中遇到的坑

喜夏-厌秋 提交于 2020-01-10 17:08:12
docker-compose能实现多个镜像集成,容器的同时启动,使用十分方便。只需要写一个docker-compose.yml文件即可。但是yml文件对格式十分严格。以下是我遇到的错误: ** 第一个: ** ERROR: yaml.scanner.ScannerError: while scanning for the next token found character ‘\t’ that cannot start any token in “.\docker-compose.yml”, line 3, column 3 原因: yml中最前面用了tab,改成空格就好了。对yaml文件格式要求严格。将原来tab改成空格就好 第二个: ERROR: yaml.scanner.ScannerError: mapping values are not allowed here in “.\docker-compose.yml”, line 4, column 17 原因: 出现这个错误的是因为yaml格式不正确,谷歌定义的yaml格式太严格了,每个冒号后面都必须带有空格 来源: CSDN 作者: 雪花不落 链接: https://blog.csdn.net/weixin_44780082/article/details/90903219