运行Cloudant作为码头组合的码头集装箱

运行Cloudant作为码头组合的码头集装箱

本文介绍了运行Cloudant作为码头组合的码头集装箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此图片与docker组合,当我使用原始的说明它的工作,但是当我将其转换为docker组合格式,它不能正常工作,我看到仪表板页面,但它是



原始运行命令:

  docker运行\ 
--privileged \
--detach \
--volume cloudant:/ srv \
--name cloudant-developer \
- 发布8080:80 \
--hostname cloudant.dev \
ibmcom / cloudant-developer

我创建的撰写文件:

 版本:'3'
服务:
cloudant:
image:ibmcom / cloudant-developer:最新
容器名:cloudant-developer
主机名:cloudant.d ev
ports:
- 8080:80
曝光:
- 80
卷:
- cloudant:/ srv
特权:true
卷:
cloudant:

感谢您的帮助。 p>

PS - 我手动执行许可协议的命令

解决方案

我一会儿想出来将云端码头码头容器绑定到默认码头网络子网。具体来说,我发现haproxy被映射到重定向到 172.17.0.2:5984 ,并且失败,因为默认情况下docker compose在不同的ip范围内创建一个新的网络。可能还有其他与此相关的问题。最终我发现您可以使用以下配置在默认的Docker网络上运行docker组合:



network_mode:bridge



所以,你的docker-compose.yml将如下所示:

  version:'3'
services:
cloudant:
image:ibmcom / cloudant-developer:最新
容器名:cloudant-developer
主机名:cloudant.dev
ports:
- 8080:80
曝光:
- 80
卷:
- cloudant:/ srv
特权:true
network_mode:bridge
volumes:
cloudant:


I am trying to use this image https://hub.docker.com/r/ibmcom/cloudant-developer/ with docker compose, when I use the original instructions it works, however when I translate it to docker compose format it doesn't work properly, I see the dashboard page but it is empty and seems broken.

The original run command:

docker run \
       --privileged \
       --detach \
       --volume cloudant:/srv \
       --name cloudant-developer \
       --publish 8080:80 \
       --hostname cloudant.dev \
       ibmcom/cloudant-developer

The compose file I created:

version: '3'
services:
  cloudant:
    image: ibmcom/cloudant-developer:latest
    container_name: cloudant-developer
    hostname: cloudant.dev
    ports:
      - "8080:80"
    expose:
      - "80"
    volumes:
      - cloudant:/srv
    privileged: true
volumes:
  cloudant:

Thanks for helping.

P.S - I do executed the commands for license agreement manually

解决方案

Took me a while to figure this out. Turns out the cloudant docker container is tied to the default docker network subnet. Specifically, I found that haproxy was mapped to redirect to 172.17.0.2:5984 and was failing because by default docker compose creates a new network in a different ip range. There may be other issues related to this. Ultimately I found that you could run docker compose on the default docker network with the following config:

network_mode: bridge

So, your docker-compose.yml would look like this:

version: '3'
  services:
    cloudant:
      image: ibmcom/cloudant-developer:latest
      container_name: cloudant-developer
      hostname: cloudant.dev
      ports:
        - "8080:80"
      expose:
        - "80"
      volumes:
        - cloudant:/srv
      privileged: true
      network_mode: bridge
  volumes:
    cloudant:

这篇关于运行Cloudant作为码头组合的码头集装箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 02:33