Docker-compose on Rancher

398 views
Skip to first unread message

Mamisoa

unread,
Dec 30, 2017, 7:10:07 PM12/30/17
to dcm4che
Hi,

I tried somehow to adapt the docker-compose.yml template to Rancher but failed.

Rancher is only compatible with version 2 of docker-compose file, but dcm4chee does not seem to have V3 specific options, does it?

Anyway, adding environment variables and swapping to v2 doesn't work.

Have anyone managed a docker-compose yml with Rancher?

Happy New Year 2018---

Mike

Mamisoa

unread,
Jan 1, 2018, 3:58:33 PM1/1/18
to dcm4che
With the following docker-compose.yml config:

version: '2'
services
:
  arc
:
    image
: dcm4che/dcm4chee-arc-psql:5.11.0
    environment
:
      ARCHIVE_DEVICE_NAME
: central-archive
      LDAP_BASE_DN
: dc=dcm4chee,dc=org
      LDAP_ROOTPASS
: secret
      POSTGRES_DB
: pacsdb
      POSTGRES_PASSWORD
: pacs
      POSTGRES_USER
: pacs
      STORAGE_DIR
: /storage/fs1
      WILDFLY_CHOWN
: /opt/wildfly/standalone /storage
      WILDFLY_WAIT_FOR
: ldap:389 db:5432
      LDAP_HOST
: ldap
      ARCHIVE_HOST
: arc
    stdin_open
: true
    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/wildfly:/opt/wildfly/standalone
   
- /var/local/dcm4chee-arc/storage:/storage
    tty: true
    logging:
      driver: json-file
      options:
        max-size: 10m
    links:
    - ldap:ldap
    - db:db
    ports:
    - 8080:8080/
tcp
   
- 8443:8443/tcp
   
- 9990:9990/tcp
   
- 11112:11112/tcp
   
- 2575:2575/tcp
    labels
:
      io
.rancher.container.pull_image: always
      io
.rancher.scheduler.affinity:host_label: tier=slave1
  ldap
:
    image
: dcm4che/slapd-dcm4chee:2.4.44-11.0
    environment
:
      AE_TITLE
: CENTRAL
      ARCHIVE_DEVICE_NAME
: central-archive
      ARCHIVE_HOST
: arc
      DICOM_PORT
: '11112'
      HL7_PORT
: '2575'
      LDAP_BASE_DN
: dc=dcm4chee,dc=org
      STORAGE_DIR
: /storage/fs1
      POSTGRES_USER
: pacs
      POSTGRES_PASSWORD
: pacs
      POSTGRES_DB
: pacsdb
    stdin_open
: true
    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/ldap:/var/lib/ldap
   
- /var/local/dcm4chee-arc/slapd.d:/etc/ldap/slapd.d
    tty
: true
    logging
:
      driver
: json-file
      options
:
        max
-size: 10m
    links
:
   
- arc:arc
    ports
:
   
- 389:389/tcp
    labels
:
      io
.rancher.container.pull_image: always
      io
.rancher.scheduler.affinity:host_label: tier=slave1
  phpldapadmin
:
    image
: osixia/phpldapadmin:latest
    environment
:
      PHPLDAPADMIN_LDAP_HOSTS
: ldap
    stdin_open
: true
    tty
: true
    links
:
   
- ldap:ldap
    ports
:
   
- 6443:443/tcp
    labels
:
      io
.rancher.container.pull_image: always
  pgadmin
:
    image
: dpage/pgadmin4:latest
    environment
:
      PGADMIN_DEFAULT_EMAIL
: mamisoa@gmail.com
      PGADMIN_DEFAULT_PASSWORD
: test
    stdin_open
: true
    tty
: true
    links
:
   
- db:db
    ports
:
   
- 8085:80/tcp
    labels
:
      io
.rancher.container.pull_image: always
      io
.rancher.scheduler.affinity:host_label: tier=slave1
  db
:
    image
: dcm4che/postgres-dcm4chee:10.0-11
    environment
:
      POSTGRES_DB
: pacsdb
      POSTGRES_PASSWORD
: pacs
      POSTGRES_USER
: pacs
    stdin_open
: true
    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/db:/var/lib/postgresql/data
    tty
: true
    logging
:
      driver
: json-file
      options
:
        max
-size: 10m
    ports
:
   
- 5432:5432/tcp
    labels
:
      io
.rancher.container.pull_image: always
      io
.rancher.scheduler.affinity:host_label: tier=slave1


I get the following error, even starting the stack in order -> ldap > db > arc

root@docker8:/var/local/dcm4chee-arc# cat /var/local/dcm4chee-arc/wildfly/log/server.log | grep 'Caused by'
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void org.dcm4chee.arc.impl.ArchiveDeviceProducer.init() on org.dcm4chee.arc.impl.ArchiveDeviceProducer@454cea1f
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void org.dcm4chee.arc.impl.ArchiveDeviceProducer.init() on org.dcm4chee.arc.impl.ArchiveDeviceProducer@454cea1f
Caused by: java.lang.reflect.InvocationTargetException
Caused by: javax.enterprise.inject.CreationException
Caused by: org.dcm4che3.conf.api.ConfigurationException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "deployment.dcm4chee-arc-ear-5.11.0-psql.ear.dcm4chee-arc-service-5.11.0.jar" from Service Module Loader [Root exception is java.lang.NumberFormatException: For input string: "tcp:"]
Caused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "deployment.dcm4chee-arc-ear-5.11.0-psql.ear.dcm4chee-arc-service-5.11.0.jar" from Service Module Loader [Root exception is java.lang.NumberFormatException: For input string: "tcp:"]
Caused by: java.lang.NumberFormatException: For input string: "tcp:"
   
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
   
Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void org.dcm4chee.arc.impl.ArchiveDeviceProducer.init() on org.dcm4chee.arc.impl.ArchiveDeviceProducer@454cea1f
   
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void org.dcm4chee.arc.impl.ArchiveDeviceProducer.init() on org.dcm4chee.arc.impl.ArchiveDeviceProducer@454cea1f
   
Caused by: java.lang.reflect.InvocationTargetException
   
Caused by: javax.enterprise.inject.CreationException
   
Caused by: org.dcm4che3.conf.api.ConfigurationException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module \"deployment.dcm4chee-arc-ear-5.11.0-psql.ear.dcm4chee-arc-service-5.11.0.jar\"
 from Service Module Loader [Root exception is
java.lang.NumberFormatException: For input string: \"tcp:\"]
   
Caused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate
 InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader
 ModuleClassLoader for Module
\"deployment.dcm4chee-arc-ear-5.11.0-psql.ear.dcm4chee-arc-service-5.11.0.jar\"
 from Service Module Loader [Root exception is
java.lang.NumberFormatException: For input string: \"tcp:\"]
    Caused by: java.lang.NumberFormatException: For input string: \"tcp:\""
}}

where:

For input string: \"tcp:\"


seems to trigger the error. But I can't find where it is from.

Any idea?

Mike

Mamisoa Andriantafika

unread,
Jan 3, 2018, 12:28:13 PM1/3/18
to dcm...@googlegroups.com
Ok I managed it to "run minimum set of archive services on a single host".

Here is the config for the stack:

version: '2'
services
:
  arc
:
    image
: dcm4che/dcm4chee-arc-psql:5.11.0
    environment
:
      ARCHIVE_DEVICE_NAME
: central-
archive
      LDAP_BASE_DN
: dc=dcm4che,dc=org
      LDAP_ROOTPASS
: secret
      POSTGRES_DB
: pacsdb
      POSTGRES_PASSWORD
: pacs
      POSTGRES_USER
: pacs
      STORAGE_DIR
: /storage/fs1
      WILDFLY_CHOWN
: /opt/wildfly/standalone /storage
      WILDFLY_WAIT_FOR
: ldap:389 db:5432
      LDAP_HOST
: ldap
      ARCHIVE_HOST
: arc
      LDAP_PORT
: '389'

    stdin_open
: true
    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/wildfly:/opt/wildfly/standalone
   
- /var/local/dcm4chee-arc/storage:/storage
    tty: true
    logging:
      driver: json-file
      options:
        max-size: 10m
    links:
    - ldap:ldap
    - db:db
    ports:
    - 8080:8080/
tcp
   
- 8443:8443/tcp
   
- 9990:9990/tcp
   
- 11112:11112/tcp
   
- 2575:2575/tcp
    labels
:
      io
.rancher.container.pull_image:
always
  ldap
:

    image
: dcm4che/slapd-dcm4chee:2.4.44-11.0
    environment
:
      AE_TITLE
: CENTRAL
      ARCHIVE_DEVICE_NAME
: central-archive
      ARCHIVE_HOST
: arc
      DICOM_PORT
: '11112'
      HL7_PORT
: '2575'

      LDAP_BASE_DN
: dc=dcm4che,dc=org
      STORAGE_DIR
: /storage/fs1
      POSTGRES_USER
: pacs
      POSTGRES_PASSWORD
: pacs
      POSTGRES_DB
: pacsdb
    stdin_open
: true

    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/ldap:/var/lib/ldap
   
- /var/local/dcm4chee-arc/slapd.d:/etc/ldap/slapd.d
    tty
: true
    logging
:
      driver
: json-file
      options
:
        max
-size: 10m
    links
:
   
- arc:arc
    ports
:
   
- 389:389/tcp
    labels
:
      io
.rancher.container.pull_image:
always
  db
:

    image
: dcm4che/postgres-dcm4chee:10.0-11
    environment
:
      POSTGRES_DB
: pacsdb
      POSTGRES_PASSWORD
: pacs
      POSTGRES_USER
: pacs
    stdin_open
: true
    volumes
:
   
- /etc/localtime:/etc/localtime:ro
   
- /etc/timezone:/etc/timezone:ro
   
- /var/local/dcm4chee-arc/db:/var/lib/postgresql/data
    tty
: true
    logging
:
      driver
: json-file
      options
:
        max
-size: 10m
    ports
:
   
- 5432:5432/tcp
    labels
:
      io
.rancher.container.pull_image: always

rancher-compose.yml

version: '2'
services
:
  arc
:
    scale
: 1
    start_on_create
: true
  ldap
:
    scale
: 1
    start_on_create
: true
  phpldapadmin
:
    scale
: 1
    start_on_create
: true
  pgadmin
:
    scale
: 1
    start_on_create
: true
  db
:
    scale
: 1
    start_on_create
: true

I had to add, even if it's set on default, LDAP_PORT=389 to arc otherwise I get the "tcp:/input" error.



Le dimanche 31 décembre 2017 01:10:07 UTC+1, Mamisoa a écrit :
Reply all
Reply to author
Forward
0 new messages