Docker群:无法卷曲到服务容器

时间:2019-09-06 14:27:51

标签: docker curl docker-compose docker-swarm docker-network

我有一个在堆栈群下运行的服务:

<style name="MyTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle"
    parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#E8AD00</item>
</style>

如您所见,我的服务正在8300端口上运行。

问题在于当我卷曲时;似乎没有回复:

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS               NAMES
de74ba4d48c1        myregistry/myApi:1.0  "java -Dfile.encodin…"   3 minutes ago       Up 3 minutes        8300/tcp            myApiCtn
  

卷曲:(52)来自服务器的空回复

在另一面,如果我手动运行容器(没有堆栈并且没有群集服务) (泊坞窗运行...)

-> 卷曲效果很好

我的 docker-compose 如下:

[user@server home]$ curl http://localhost:8300/api/elk/batch

我的网络列表如下:

---
version: '3.4'
services:
  api-batch:
    image: myRegistry/myImageApi
    networks:
      - net_common
      - default
    stdin_open: true
    volumes:
    - /opt/application/current/logs:/opt/application/current/logs
    - /var/opt/data/flat/flf/:/var/opt/data/flat/flf/
    tty: true
    ports:
      - target: 8300
        published: 8300
        protocol: tcp
    deploy:
      mode: global
      resources:
        limits:
          memory: 1024M      
      placement:
        constraints:
          - node.labels.type == test
    healthcheck:
      disable: true
networks:
  net_common:
    external: true     

是否有任何建议使其在群集服务下工作?

0 个答案:

没有答案
相关问题