docker-compose.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # format 3.x, validated on W10 - there is no "mode/uid/gid" for docker-compose 1.29/W10
  2. # you should provide your private/public RSA key in ./ssh dir (named id_rsa.mpi/id_rsa.mpi.pub)
  3. # docker swarm init, then you have to do // note version_mpinet is the name of the overlay
  4. # docker network create --driver=overlay --attachable yml_mpinet
  5. # Nov, 13, 2021 - Jean-Michel Batto
  6. version: "3.9"
  7. services:
  8. mpihead:
  9. image: jmbatto/m2chps-mpi41:latest
  10. volumes:
  11. - /var/run/docker.sock:/var/run/docker.sock
  12. - usrlocalvarmpi-foo:/usr/local/var/mpishare
  13. ports:
  14. - "22"
  15. links:
  16. - mpinode
  17. networks:
  18. - mpinet
  19. secrets:
  20. - source: "id_rsa"
  21. target: "/home/mpiuser/.ssh-source/id_rsa"
  22. - source: "id_rsa_mpi_pub"
  23. target: "/home/mpiuser/.ssh-source/id_rsa.pub"
  24. - source: "authorized_keys"
  25. target: "/home/mpiuser/.ssh-source/authorized_keys"
  26. mpinode:
  27. image: jmbatto/m2chps-mpi41:latest
  28. volumes:
  29. - /var/run/docker.sock:/var/run/docker.sock
  30. - usrlocalvarmpi-foo:/usr/local/var/mpishare
  31. networks:
  32. - mpinet
  33. secrets:
  34. - source: "id_rsa"
  35. target: "/home/mpiuser/.ssh-source/id_rsa"
  36. - source: "id_rsa_mpi_pub"
  37. target: "/home/mpiuser/.ssh-source/id_rsa.pub"
  38. - source: "authorized_keys"
  39. target: "/home/mpiuser/.ssh-source/authorized_keys"
  40. secrets:
  41. id_rsa_mpi_pub:
  42. file: ssh/id_rsa.mpi.pub
  43. id_rsa:
  44. file: ssh/id_rsa.mpi
  45. authorized_keys:
  46. file: ssh/id_rsa.mpi.pub
  47. networks:
  48. mpinet:
  49. external: true
  50. name : yml_mpinet
  51. driver: overlay
  52. volumes:
  53. usrlocalvarmpi-foo: