docker-compose

Docker三剑客——docker-compose

妖精的绣舞 提交于 2019-12-24 00:20:17
一、Docker-Compose简介 Compose是用于定义和运行容器docker应用程序的工具。通过Compose,可以使用YAML文件来配合应用程序需要的所有的服务。然后,使用一个命令,就可以从YAML文件配合中创建并启动所有服务。那么就需要了解YAML文件的基本语法。 YAML文件基本语法: 大小写敏感; 使用缩进表示层级关系; 缩进不允许使用tab,只允许空格; 缩进的空格数不重要,只要相同等级的元素左对齐即可; “#”表示注释; Docker-Compose是一个容器编排工具。通过一个.yml或.yaml文件,将所有的容器的部署方法、文件映射、容器端口映射等情况写在一个配置文件里,执行docker-compose up命令就像执行脚本一样,一个一个的安装并部署容器。 Dockerfile 可以让用户管理一个单独的应用容器;而 Compose 则允许用户在一个模板(YAML 格式)中定义一组相关联的应用容器; Docker Compose将所管理的容器分为三层: 工程(project); 服务(service); 容器(container); docker compose运行目录下的所有yml文件组成一个工程,一个工程包含多个服务,每个服务中定义了容器运行的镜像、参数、依赖。一个服务可包括多个容器实例。 docker-compose就是docker容器的编排工具

Docker compose volume mapping with NodeJS app

烈酒焚心 提交于 2019-12-24 00:10:03
问题 I am trying to achieve something incredibly basic, but have been going at this for a couple of evenings now and still haven't found a solid (or any) solution. I have found some similar topics on SO and followed what was on there but to no avail, so I have created a GitHub repo for my specific case. What I'm trying to do: Be able to provision NodeJS app using docker-compose up -d (I plan to add further containers in future, omitted from this example) Ensure the code is mapped via volumes so I

Docker Compose injecting linked containers in v2

自作多情 提交于 2019-12-23 22:28:08
问题 In v1 of Docker Compose, the /etc/hosts file is updated with linked containers. E.g. $ cat /etc/hosts 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.17.0.2 redis redis_1 c381c79fb9c2 romantic_yonath 172.17.0.3 48d2ed7033a1 However, in v2, this is done via DNS, so there are no entries anymore. I could use the hosts table to bootstrap a load balancer; very useful when used in conjunction

Ubuntu搭建face_recognition环境 从0开始docker安装 测试OK

匆匆过客 提交于 2019-12-23 21:43:13
基本上两种方式安装 1,安装dlib pip安装 依赖较多 过程稍微复杂 2,docker 快速安装 快速省事 项目地址 https://github.com/ageitgey/face_recognition 建议看英文readme 中文docker讲的少了信息 Dockerfile 路径 https://github.com/ageitgey/face_recognition/blob/master/Dockerfile Docker菜鸟教程 https://www.runoob.com/docker/docker-tutorial.html 1,准备服务器Ubuntu18.04 2,安装docker 等待安装完成 测试docker是否正常 # sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:4fe721ccc2e8dc73622dc660d833570ec2682f4e4194f4ee23e415e1064 Status: Downloaded newer image for hello-world

run neo4j with docker-compose - neo4j not accessible from localhost:7474

半城伤御伤魂 提交于 2019-12-23 20:18:40
问题 ---EDITED -- NO LONGER WORKING --- PLEASE HELP--- maybe something is changed in the latest neo4j image (SE MY ANSWER BELOW FOR MORE DETAILS) I'm try to run neo4j with docker-compose by means of this github repo (that contains the docker-compose.yml) https://github.com/GraphRM/workshop-neo4j-docker The docker-compose file conteined in this repo is nothing more that a plain neo4j docker image with some data already attached (you can try yourself, the image is realy small) Running this file

Is there a workaround to use the host's network in Docker for Mac?

非 Y 不嫁゛ 提交于 2019-12-23 19:40:45
问题 Since Docker for Mac does not use Virtualbox but rather uses xhyve there is no straightforward way to access my mac's network (specifically for VPN and network attached devices) using network_mode: host or --network host . I've searched and searched but have found no simple workaround. The best solution I've figured out is to run a Linux virtualbox then install docker on that and execute docker-compose up or docker run in there. Not ideal at all. 回答1: This doesn't seem to be possible. There

Where docker named volumes are stored? [duplicate]

这一生的挚爱 提交于 2019-12-23 19:27:56
问题 This question already has an answer here : Docker: where is docker volume located for this compose file (1 answer) Closed 2 years ago . I have this docker-compose.yml file version: '3' volumes: jenkins_home: services: registry: image: registry:2 ports: - "5000:5000" jenkins: image: jenkins/jenkins ports: - "9090:8080" volumes: - jenkins_home:/var/jenkins_home As you can see, there is a named volume called jenkins_home , now I wonder, where does the data get really persisted? running docker

Fabric Network - what happens when a downed peer connects back to the network?

自闭症网瘾萝莉.ら 提交于 2019-12-23 19:16:09
问题 I recently deployed the fabric network using Docker-compose, I was trying to simulate a downed peer. Essentially this is what happens: 4 peers are brought online using docker-compose running a fabric network 1 peer i.e the 4th peer goes down (done via docker stop command) Invoke transactions are sent to the root peer which is verified by querying the peers after sometime (excluding the downed peer). The downed peer is brought back up with docker start. Query transaction run fine on the always

Setting volumes in docker-compose.yml file for windows 10 home

旧巷老猫 提交于 2019-12-23 19:10:00
问题 Trying to set up docker so that when I change my project files on my windows machine they are updated in my docker container. From this question I learned that you should use the volumes setting in the docker-compose.yml file. But I still can't get it to work. I have tried to set the volumes to (+30 similar combinations): volumes: - x .:/home/app/angular-seed //c/Users/k/dev/angular-seed/:/home/app/angular-seed c/Users/k/dev/angular-seed:/home/app/angular-seed C:/User/k/dev/angular-seed I

What happens when docker daemon runs out of network IP addresses to allocate when deploying compose environments?

那年仲夏 提交于 2019-12-23 18:47:54
问题 Currently, we are deploying a compose environment stack to an ubuntu server. In the compose file, we are not defining an address and utilizing the underlying default docker bridge network that docker compose comes with out of the box. When we deploy our compose environment to a development server (IP range 10.x.x.x), the base docker0 network address starts at 172.17.0.0 . For every subsequent deployment, the address is incremented, (i.e. 172.18.0.0 , and then 172.19.0.0 ) - this is expected.