在码头上运行码头工作

时间:2016-08-16 08:08:51

标签: docker docker-compose docker-swarm

我有一个撰写文件:

搬运工-compose.yml

openjdk-6b36-jdk:
  image: java:openjdk-6b36-jdk
  volumes:
   - ./src:/src
   - ./build/openjdk-6b36-jdk:/build
  command: /src/compileAndTest

openjdk-7u79-jdk:
  image: java:openjdk-7u79-jdk
  volumes:
   - ./src:/src
   - ./build/openjdk-7u79-jdk:/build
  command: /src/compileAndTest

openjdk-8u66-jdk:
  image: java:openjdk-8u66-jdk
  volumes:
   - ./src:/src
   - ./build/openjdk-8u66-jdk:/build
  command: /src/compileAndTest

运行良好:

-bash-4.2$ docker-compose up
Starting compose_openjdk-7u79-jdk_1
Starting compose_openjdk-8u66-jdk_1
Starting compose_openjdk-6b36-jdk_1
Attaching to compose_openjdk-8u66-jdk_1, compose_openjdk-7u79-jdk_1, compose_openjdk-6b36-jdk_1
openjdk-7u79-jdk_1  | Hello, World
openjdk-8u66-jdk_1  | Hello, World
openjdk-6b36-jdk_1  | Hello, World
compose_openjdk-7u79-jdk_1 exited with code 0
compose_openjdk-8u66-jdk_1 exited with code 0
compose_openjdk-6b36-jdk_1 exited with code 0

我想在swarm集群中运行它 这样做的命令是什么?

会是docker -H :4000 run <something>?吗 因为我用来在群集节点上运行图像的命令

我可以运行docker -H :4000 run hello-world,但这些是泊坞窗图片。你如何在群集群中运行docker compose?

即。我希望compose_openjdk-7u79-jdk_1转到一个节点并使用compose_openjdk-8u66-jdk_1转到另一个节点,依此类推?

0 个答案:

没有答案