Db2

 View Only
Expand all | Collapse all

DB2 LUW. 11.5.xx - Mac M1 ready

  • 1.  DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Mon January 18, 2021 07:58 PM
    Hello,

    Is the DB2 LUW community edition 11.5.xx (may be on docker) M1 ready?


    My profile



    Juergen Jost

    #Db2


  • 2.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Tue January 19, 2021 02:54 AM
    maybe there is some testing of LUW 11.5.xx on Rosetta
    from macrumors:
    Macs powered by Apple silicon, such as the M1 MacBook Pro, can run both iOS apps and Mac apps, but they can also run x86-64 software that's been built to work on Intel architecture, thanks to something called Rosetta 2.

    ------------------------------
    Jürgen Jost
    DB2 DBA (LUW / zOS)
    ------------------------------



  • 3.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Wed January 26, 2022 10:21 AM
    It doesn't look good from everything I can see. The official Docker image lists itself as not compatible with arm64, and when you try via Rosetta/x86 emulation, you run into problems as described here.

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 4.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Wed January 26, 2022 10:30 AM

    Would love to know the same. Having changed computers recently to an M1 and realizing that none of the IBM DB2 stuff works was disappointing.

    I am talking about both the Docker image (https://hub.docker.com/r/ibmcom/db2), as well as the CLI driver (https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/).

    For us, the Docker image does not seem to know the db2 command, even when run in x86 mode:

    /bin/bash: db2stop: command not found

    As it stands, this makes development with M1 very hard because we now have to find ways around these hurdles.



    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 5.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu January 27, 2022 05:07 AM

    When downloading the docker image, I got the following:

    latest: Pulling from ibmcom/db2

    no matching manifest for linux/arm64/v8 in the manifest list entries

    PS
    postgresql works on M1



    ------------------------------
    Jürgen Jost
    DB2 DBA (LUW / zOS)
    ------------------------------



  • 6.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu January 27, 2022 08:12 AM
    You can try the following to make it run in x86 emulated mode:
    docker run -it --name db2 -e DBNAME=testdb -v ~/:/database -e DB2INST1_PASSWORD=GD1OJfLGG64HV2dtwK -e LICENSE=accept -p 50000:50000 --privileged=true --platform=linux/amd64 ibmcom/db2

    As stated above, this will not work as it will not be able to find db2 and db2stop. For me, I get the following output:
    (*) Previous setup has not been detected. Creating the users... 
    (*) Creating users ...
    (*) Creating instance ... 
    DBI1446I  The db2icrt command is running.
    DB2 installation is being initialized.
     Total number of tasks to be performed: 4 
    Total estimated time for all tasks to be performed: 309 second(s) 
    Task #1 start
    Description: Setting default global profile registry variables 
    Estimated time 1 second(s) 
    Task #1 end 
    Task #2 start
    Description: Initializing instance list 
    Estimated time 5 second(s) 
    Task #2 end 
    Task #3 start
    Description: Configuring DB2 instances 
    Estimated time 300 second(s) 
    Task #3 end 
    Task #4 start
    Description: Updating global profile registry 
    Estimated time 3 second(s) 
    Task #4 end 
    The execution completed successfully.
    For more information see the DB2 installation log at "/tmp/db2icrt.log.195".
    DBI1070I  Program db2icrt completed successfully.
    (*) Fixing /etc/services file for DB2 ... 
    /bin/bash: db2stop: command not found
    
    And then a lot of error output follows.

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 7.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu February 10, 2022 03:07 AM
    I would very much like to hear a response from an IBM employee on this. M1 has been around for a year and is now the default architecture for new Macs. More and more people are getting M1 Macs so this issue will not go away but rather become more pressing over time.

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 8.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Fri February 11, 2022 10:04 AM
    @Jonathan Herdt I'm aware of the issue and will investigate. Will provide a response to this thread once I know more. ​

    ------------------------------
    IRINA DELIDJAKOVA
    ------------------------------



  • 9.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Wed March 02, 2022 01:03 PM
    Hi All, this will not be an easy fix and we will need to support Db2 server on arm64 architectures before the container can support it as well. We are planning this for a future Db2 version - no particular date in plan yet as it is currently being evaluated.

    ------------------------------
    IRINA DELIDJAKOVA
    ------------------------------



  • 10.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu March 03, 2022 03:23 AM
    @IRINA DELIDJAKOVA Hey Irina, thanks a lot for being open about this and very good to hear that you're working on it. I understand that this will be challenging and that it can take time. Any​ chance you could work on making the x86 emulation work in the meantime, in case that's easier/quicker (see my message above for how to start Docker like this)? 🙏

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 11.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Wed November 16, 2022 06:58 AM
    Hello @IRINA DELIDJAKOVA, are there any updates about DB2 on Docker?​​

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 12.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Tue April 12, 2022 09:32 AM
    Also suffering from the lack of M1 support, would love to see a fix.

    ------------------------------
    Ashlen Kurre
    ------------------------------



  • 13.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Mon April 25, 2022 12:10 PM
    Was able to find a working solution by running `export DOCKER_DEFAULT_PLATFORM=linux/amd64` before starting my container. This apparently enables a (poorly documented?) x86 compatibility mode in Docker :) You might have to remove your image first before this.

    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 14.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Mon April 25, 2022 02:14 PM
    Hi @Jonathan Herdt, thanks for looking into this!! We are also going through some of the issues before we can publish a new container with instructions. Using the export env, helps with some issues, but not all. We're still hitting other issues that are being looked at -  example some env not persisted. Can you provide the logs from your run? I am surprised you're successful with just that workaround. ​​

    ------------------------------
    IRINA DELIDJAKOVA
    ------------------------------



  • 15.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Tue April 26, 2022 07:20 AM
    Sure thing, I did two runs. The way we use DB2 will likely not cover all use cases there are for it so it's possible that we just haven't run into any issues because of that.

    First run:

    docker run -it --name db2 -e DBNAME=testdb -v ~/:/database -e DB2INST1_PASSWORD=GD1OJfLGG64HV2dtwK -e LICENSE=accept -p 50000:50000 --privileged=true --platform=linux/amd64 ibmcom/db2
    Unable to find image 'ibmcom/db2:latest' locally
    latest: Pulling from ibmcom/db2
    8dfe9326f733: Pull complete 
    0d875a68bf99: Pull complete 
    50e8fb20327b: Pull complete 
    a0c05fd037e6: Pull complete 
    1cd5cf0a05ba: Pull complete 
    6c97ca72f52c: Pull complete 
    e0c22e12ea4e: Pull complete 
    06fa0bd3b2ef: Pull complete 
    01d61e0e2f08: Pull complete 
    849d15abca93: Pull complete 
    be6ee447107f: Pull complete 
    408a6e6d33a2: Pull complete 
    a9c177505816: Pull complete 
    Digest: sha256:81d01c71ed0d1ae27ee51ab53133610970b25b60de385a0c1906fe53017f4c96
    Status: Downloaded newer image for ibmcom/db2:latest
    (*) Previous setup has not been detected. Creating the users... 
    (*) Creating users ...
    (*) Creating instance ... 
    DBI1446I  The db2icrt command is running.
    
    
    DB2 installation is being initialized.
    
     Total number of tasks to be performed: 4 
    Total estimated time for all tasks to be performed: 309 second(s) 
    
    Task #1 start
    Description: Setting default global profile registry variables 
    Estimated time 1 second(s) 
    Task #1 end 
    
    Task #2 start
    Description: Initializing instance list 
    Estimated time 5 second(s) 
    Task #2 end 
    
    Task #3 start
    Description: Configuring DB2 instances 
    Estimated time 300 second(s) 
    Task #3 end 
    
    Task #4 start
    Description: Updating global profile registry 
    Estimated time 3 second(s) 
    Task #4 end 
    
    The execution completed successfully.
    
    For more information see the DB2 installation log at "/tmp/db2icrt.log.229".
    DBI1070I  Program db2icrt completed successfully.
    
    
    (*) Fixing /etc/services file for DB2 ... 
    04/25/2022 15:31:25     0   0   SQL1032N  No start database manager command was issued.
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    (*) Cataloging existing databases
    ls: cannot access '/database/data/db2inst1/NODE0000': No such file or directory
    (*) Applying Db2 license ...
    
    LIC1402I  License added successfully.
    
    
    LIC1426I  This product is now licensed for use as outlined in your License Agreement.  USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V11.5/license/en_US.iso88591"
    (*) Saving the checksum of the current nodelock file ...
    (*) Updating DBM CFG parameters ... 
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    No Cgroup memory limit detected, instance memory will follow automatic tuning
    (*) Remounting /database with suid... 
    (*) Nothing appears in the Db2 directory. will skip update/upgrade.
    (*) Code level is the same. No update/upgrade needed.
    
    DB2 State : Operable
    DB2 has not been started
    Starting DB2...
    
    04/25/2022 15:33:08     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    (*) User chose to create testdb database
    (*) Creating database testdb ... 
    DB20000I  The CREATE DATABASE command completed successfully.
    DB20000I  The ACTIVATE DATABASE command completed successfully.
    04/25/2022 15:36:15     0   0   SQL1026N  The database manager is already active.
    SQL1026N  The database manager is already active.
    ### Enabling LOGARCHMETH1
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 11.5.7.0
     SQL authorization ID   = DB2INST1
     Local database alias   = TESTDB
    
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    SQL1363W  One or more of the parameters submitted for immediate modification 
    were not changed dynamically. For these configuration parameters, the database 
    must be shutdown and reactivated before the configuration parameter changes 
    become effective.
    ### Restarting DB2
    04/25/2022 15:36:27     0   0   SQL1064N  DB2STOP processing was successful.
    SQL1064N  DB2STOP processing was successful.
    04/25/2022 15:36:28     0   0   SQL1042C  An unexpected system error occurred.
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    ### Making backup directory and performing backup
    SQL1032N  No start database manager command was issued.
    (!) Failed to back up testdb database
    (*) Applying autoconfiguration for instance ... 
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    SQL1024N  A database connection does not exist.  SQLSTATE=08003
    04/25/2022 15:36:37     0   0   SQL1032N  No start database manager command was issued.
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    04/25/2022 15:36:38     0   0   SQL1042C  An unexpected system error occurred.
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    (!) Failed to automatically configure testdb database
    (*) Skipping TEXT_SEARCH setup for database testdb because TEXT_SEARCH is not configured for the instance ...
    ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
    (*) All databases are now active. 
    (*) Setup has completed.
    false
    
    2022-04-25-15.36.38.674765+000 I167521E393           LEVEL: Warning
    PID     : 36948                TID : 275370269632    PROC : db2start
    INSTANCE: db2inst1             NODE : 000
    HOSTNAME: 9bcdfdc2bdb7
    FUNCTION: DB2 UDB, base sys utilities, sqleReleaseStStLockFile, probe:16187
    MESSAGE : Released lock on the file:
    DATA #1 : String, 50 bytes
    /database/config/db2inst1/sqllib/ctrl/db2strst.lck​

    Second run:
    > docker run -it --name db2 -e DBNAME=testdb -e DB2INST1_PASSWORD=GD1OJfLGG64HV2dtwK -e LICENSE=accept -p 50000:50000 --privileged=true --platform=linux/amd64 ibmcom/db2
    
    (*) Previous setup has not been detected. Creating the users... 
    (*) Creating users ...
    (*) Creating instance ... 
    DBI1446I  The db2icrt command is running.
    
    
    DB2 installation is being initialized.
    
     Total number of tasks to be performed: 4 
    Total estimated time for all tasks to be performed: 309 second(s) 
    
    Task #1 start
    Description: Setting default global profile registry variables 
    Estimated time 1 second(s) 
    Task #1 end 
    
    Task #2 start
    Description: Initializing instance list 
    Estimated time 5 second(s) 
    Task #2 end 
    
    Task #3 start
    Description: Configuring DB2 instances 
    Estimated time 300 second(s) 
    Task #3 end 
    
    Task #4 start
    Description: Updating global profile registry 
    Estimated time 3 second(s) 
    Task #4 end 
    
    The execution completed successfully.
    
    For more information see the DB2 installation log at "/tmp/db2icrt.log.229".
    DBI1070I  Program db2icrt completed successfully.
    
    
    (*) Fixing /etc/services file for DB2 ... 
    04/25/2022 15:53:02     0   0   SQL1032N  No start database manager command was issued.
    SQL1032N  No start database manager command was issued.  SQLSTATE=57019
    (*) Cataloging existing databases
    ls: cannot access '/database/data/db2inst1/NODE0000': No such file or directory
    (*) Applying Db2 license ...
    
    LIC1402I  License added successfully.
    
    
    LIC1426I  This product is now licensed for use as outlined in your License Agreement.  USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V11.5/license/en_US.iso88591"
    (*) Saving the checksum of the current nodelock file ...
    (*) Updating DBM CFG parameters ... 
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
    successfully.
    No Cgroup memory limit detected, instance memory will follow automatic tuning
    (*) Remounting /database with suid... 
    (*) Nothing appears in the Db2 directory. will skip update/upgrade.
    (*) Code level is the same. No update/upgrade needed.
    
    DB2 State : Operable
    DB2 has not been started
    Starting DB2...
    
    04/25/2022 15:54:31     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    (*) User chose to create testdb database
    (*) Creating database testdb ... 
    DB20000I  The CREATE DATABASE command completed successfully.
    DB20000I  The ACTIVATE DATABASE command completed successfully.
    04/25/2022 15:56:43     0   0   SQL1026N  The database manager is already active.
    SQL1026N  The database manager is already active.
    ### Enabling LOGARCHMETH1
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 11.5.7.0
     SQL authorization ID   = DB2INST1
     Local database alias   = TESTDB
    
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    SQL1363W  One or more of the parameters submitted for immediate modification 
    were not changed dynamically. For these configuration parameters, the database 
    must be shutdown and reactivated before the configuration parameter changes 
    become effective.
    ### Restarting DB2
    04/25/2022 15:56:54     0   0   SQL1064N  DB2STOP processing was successful.
    SQL1064N  DB2STOP processing was successful.
    04/25/2022 15:56:57     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    ### Making backup directory and performing backup
    
    Backup successful. The timestamp for this backup image is : 20220425155701
    
    (*) Applying autoconfiguration for instance ... 
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 11.5.7.0
     SQL authorization ID   = DB2INST1
     Local database alias   = TESTDB
    
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    SQL1363W  One or more of the parameters submitted for immediate modification 
    were not changed dynamically. For these configuration parameters, the database 
    must be shutdown and reactivated before the configuration parameter changes 
    become effective.
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
    SQL1363W  One or more of the parameters submitted for immediate modification 
    were not changed dynamically. For these configuration parameters, the database 
    must be shutdown and reactivated before the configuration parameter changes 
    become effective.
    DB20000I  The SQL command completed successfully.
    04/25/2022 15:57:20     0   0   SQL1064N  DB2STOP processing was successful.
    SQL1064N  DB2STOP processing was successful.
    04/25/2022 15:57:24     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    (*) Skipping TEXT_SEARCH setup for database testdb because TEXT_SEARCH is not configured for the instance ...
    ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
    (*) All databases are now active. 
    (*) Setup has completed.
                      Log File Size: 1024
    
    2022-04-25-15.57.46.986055+000 E250474E526           LEVEL: Event
    PID     : 38573                TID : 275590932224    PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TESTDB
    APPHDL  : 0-7                  APPID: 172.17.0.1.60550.220425155744
    AUTHID  : DB2INST1             HOSTNAME: a39a8d31c347
    EDUID   : 22                   EDUNAME: db2agent (idle) 0
    FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::FreeResourcesOnDBShutdown, probe:16859
    STOP    : DATABASE: TESTDB   : DEACTIVATED: NO
    tail: inotify cannot be used, reverting to polling: Function not implemented
    ​


    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 16.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Wed April 27, 2022 05:18 PM
    Hi Jonathan, thanks for these posts. 

    Tried running the below command and getting error. Could you please suggest how to fix this issue. We are using Mac M1 chip (OS - Moneterey)

    podman run -h db2server --name db2server --detach --privileged=true -p 50000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -v /var/home/core/.spmdb:/database --platform=linux/amd64 ibmcom/db2

    35a107a7edf3de15720c01dd0182a946ef596c02435c94234dde5a7ff131b605

    <user>@<home> ~ %ERRO[0332] accept tcp [::]:50000: use of closed network connection

    Thank you.

    Mohanavalli



    ------------------------------
    Mohanavalli Ilangovan
    ------------------------------



  • 17.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu April 28, 2022 02:44 AM
    Edited by System Fri January 20, 2023 04:39 PM
    Hi Mohanavalli, the error you're posting suggests a problem with your port configuration (either on your host machine or in your Docker container) but that's as far as I can get here since I don't have much experience with podman. I had tried out podman as well for db2 but ran into other issues. If you can't or don't want to use Docker, I was successful with colima: Install colima as described on their GitHub page and then start it in emulated mode like colima start --arch x86_64. Now you will be able to use your ibmcom/db2 image the way you're used to.

    Remember that if this doesn't work, you might have to delete your locally stored image, ie docker image rm your_img or similar.


    ------------------------------
    Jonathan Herdt
    ------------------------------



  • 18.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu March 30, 2023 09:13 AM

    Hi Jonathan, quite late but thank you for sharing this.

    I am new to this field and I am wondering how do I proceed to the second run after the first run is completed. Do I run the command in the same terminal? If so, how do I do it because pressing enter didnt do anything. 

    - Currently using Mac M1 Ventura.



    ------------------------------
    Nur Insyirah Abd Jalin
    ------------------------------



  • 19.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu March 30, 2023 10:23 AM

    Hello @Sheah 

    If you ran the first command, there's no need to run the second command. The two runs are just two alternative commands, you don't need to run both. If the first succeeded for you, then you can go ahead and begin using the container. To do so you can run: 

    docker exec -ti db2 bash -c "su – db2inst1"

    For more information please see the documentation page: https://www.ibm.com/docs/en/db2/11.5?topic=system-macos.

    Please note that ibmcom/db2 is getting sunset. The replacement is icr.io/db2_community/db2. This is documented in the link above as well



    ------------------------------
    Mohamed Bengezi
    ------------------------------



  • 20.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu March 30, 2023 10:24 AM

    Hello @Sheah 

    If you completed the first command, you don't need to run the second command. They are alternatives. If the first command completed successfully, then all that's left is to log into your container. You can do so with 

    docker exec -ti db2 bash -c "su – db2inst1"

    where 'db2' is your container name. If you've changed the container name, replace 'db2' with your container name. These instructions for setting up can be found here: https://www.ibm.com/docs/en/db2/11.5?topic=system-macos. Please note that 'ibmcom/db2' is being sunset, and is replaced by icr.io/db2_community/db2. 

    Regards,

    Mohamed



    ------------------------------
    Mohamed Bengezi
    ------------------------------



  • 21.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu January 04, 2024 10:25 AM

    Hi Jonathan,

    I know it is nearly 2 years, I hope this description would help people still facing this issue trying to run db2 community edition container on mac m1.

    I'm using podman with lima as rootful along with db2 community edition container
    I followed the below link. In my case, it resolved another issue to be running the instance as rootful.

    https://kellyrodger.medium.com/db2-on-apple-silicon-e697d3fdc76c

    I'm using podman-compose you can rather use podman file.

    this my yml compose file:

    version: "3.8"
    services:
    db2:
    image: "icr.io/db2_community/db2:11.5.8.0"
    platform: "linux/amd64"
    container_name: "db2"
    hostname: "db2"
    privileged: true
    restart: "on-failure"
    entrypoint: ["/bin/bash", "-c", ". /root/host/install.sh"]
    command: ["/bin/bash", "-c", "echo \"db2 started successfully\""]
    ports:
    - "22022:22"
    - "50000:50000"
    environment:
    LICENSE: "accept"
    DB2INSTANCE: "db2inst1"
    DB2INST1_PASSWORD: <specify a password>
    IS_OSXFS: "true"
    volumes:
    - db2-database:/database
    - db2-hadr:/hadr
    - <path to install.sh>:/root/host

    for the install.sh will be as below:

    #!/bin/bash
    date && \
    env && \
    if [ "$(cat /database/config/db2inst1/result)" != "success" ]; then \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c '/su - db2inst1 -c '. .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c \"/su - db2inst1 -c \". .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${DB2INSTANCE?} -c '/su - \${DB2INSTANCE?} -c '. .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${DB2INSTANCE?} -c \"/su - \${DB2INSTANCE?} -c \". .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance?} -c '/su - \${instance?} -c '. .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance?} -c \"/su - \${instance?} -c \". .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance_name?} -c '/su - \${instance_name?} -c '. .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance_name?} -c \"/su - \${instance_name?} -c \". .profile \&\& /g" {} + && \
    find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c \\\\\"/su - db2inst1 -c \\\". .profile \&\& /g" {} + && \
    echo \"success\" &> /database/config/db2inst1/result"
    fi | \
    ( \
    sleep 30s && \
    . /var/db2_setup/lib/setup_db2_instance.sh
    )

    Regards,

    Mohamed Asfour



    ------------------------------
    Mohamed Asfour
    ------------------------------



  • 22.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Mon February 05, 2024 01:12 PM

    Is it working for you post macos 14.3?  I'm not using lima/podman, but am using docker desktop w/rosetta enabled.  I get similar error to what's described here:

    https://stackoverflow.com/questions/77870884/db2start-error-while-loading-shared-libraries-libicudatadb2-so-32-cannot-enab/77905186#77905186



    ------------------------------
    Zamir Juma
    ------------------------------



  • 23.  RE: DB2 LUW. 11.5.xx - Mac M1 ready

    Posted Thu February 15, 2024 07:15 AM

    Hi, sorry for the late response. Yes, it is still working on macos 14.3.1.

    I did some research over the internet and I think this might help, but didn't try it myself.
    You need to force docker to use linux/amd64 by typing in the same terminal before you type docker-compose "export DOCKER_DEFAULT_PLATFORM=linux/amd64".

    If this didn't work, please check the topic of rootless and rootful containers because I believe that you are trying to run a rootless container while instead you should be running a rootful container.
    The default of docker is to run rootful containers, though since M1, there were a lot of problems emerging from this processor architecture.
    https://infosecadalid.com/2021/08/30/containers-rootful-rootless-privileged-and-super-privileged/

    That is why I went with podman and lima to give me rootful privileges over the containers I build.
    In addition, Docker now has a fee for commercial use
    https://www.docker.com/pricing/



    ------------------------------
    Mohamed Asfour
    ------------------------------