Topic Thread

Expand all | Collapse all

trying to use DB2 as part of docker-compose.yml

  • 1.  trying to use DB2 as part of docker-compose.yml

    Posted Mon December 23, 2019 09:21 AM

    when trying to use the db2 docker image from a docker-compose-yml file and running "docker-compose up" I'm getting this error:

    db2_1 | No Cgroup memory limit detected, instance memory will follow automatic tuning
    db2_1 | (*) Remounting /database with suid...
    db2_1 | (*) Nothing appears in the Db2 directory. will skip update/upgrade.
    db2_1 | (*) Code level is the same. No update/upgrade needed.
    db2_1 |
    db2_1 | DB2 State : Operable
    db2_1 | DB2 has not been started
    db2_1 | Starting DB2...
    db2_1 |
    db2_1 | 12/23/2019 09:48:06 0 0 SQL1063N DB2START processing was successful.
    db2_1 | SQL1063N DB2START processing was successful.
    db2_1 | ssh-keygen: generating new host keys: RSA1 RSA DSA ECDSA ED25519
    db2_1 | (*) All databases are now active.
    db2_1 | (*) Setup has completed.
    db2_1 | /var/db2_setup/lib/setup_db2_instance.sh: line 193: instance_name: parameter null or not set
    eco_webbackend_db2_1 exited with code 1


    this is the configuration I have in the docker-compose.yml

    db2:
    image: ibmcom/db2
    privileged: true
    ports:
    - 50000:50000
    environment:
    DB2INST1_PASSWORD: apassword
    LICENSE: accept
    DBNAME: testdb
    command: db2start
    volumes:
    - ./database:/database


    what could be the issue ?



    ------------------------------
    ARI VOLCOFF
    ------------------------------


  • 2.  RE: trying to use DB2 as part of docker-compose.yml

    Posted Mon February 10, 2020 11:22 AM
    I realize that this was posted a while ago but I ran across this post while searching because I had the exact same error and I figured out why it was happening so I thought I would post the solution for the next person.

    The issue is caused by this line in the docker-compose file:

    command: db2start
    Once I removed that the line everything started fine. I believe that this line fine if you do not specify a database to create but once you specify to create a database with DBNAME then adding the db2start command causes it to fail.

    Hope that helps someone else.

    ------------------------------
    John Rofrano
    ------------------------------



  • 3.  RE: trying to use DB2 as part of docker-compose.yml

    Posted Tue February 11, 2020 03:23 AM
    hi, do not use command until you have a valid start up script. the command option overrides the default image entrypoint script. which in a db2 case creates the instance, adds users, makes config etc. without this startup script you do not have a running instance. for your specific case: delete the command line from your yml

    ------------------------------
    Markus Fraune
    ------------------------------