title: ibmcom/db2 docker image fails on m1
body: <p>I'm having trouble setting up DB2 on macOS via Docker on my M1-Max MacBook Pro (32 GB RAM). I already had a look at <a href="https://stackoverflow.com/questions/61373195/ibmcom-mq-docker-image-backward-compatibility-issue">this question</a>, which might be related, however there is not a lot of information and I cannot exactly say, if it is about the exact same thing.
  I set up following docker-compose.yml:</p>
  <pre>
  version: '3.8'
  
  services:
    db2:
      image: ibmcom/db2
      platform: linux/amd64
      container_name: db2-test
      privileged: true
      environment:
        LICENSE: "accept"
        DB2INSTANCE: "db2dude"
        DB2INST1_PASSWORD: "db2pw"
        DBNAME: "RC1DBA"
        BLU: "false"
        ENABLE_ORACLE_COMPATIBILITY: "false"
        UPDATEVAIL: "NO"
        TO_CREATE_SAMPLEDB: "false"
        REPODB: "false"
        IS_OSXFS: "true"
        PERSISTENT_HOME: "true"
        HADR_ENABLED: "false"
        ETCD_ENDPOINT: ""
        ETCD_USERNAME: ""
        ETCD_PASSWORD: ""
      volumes: 
         - ~/workspace/docker/db2-error/db2/database:/database
         - ~/workspace/docker/db2-error/db2/db2_data:/db2_data
      ports:
        - 50000:50000
  </pre>
  <p>on my Intel-MacBook, this spins up without any issue, on my M1-MacBook however I see after <code>Task #4</code> finished, I see following portion inside of the STDOUT:</p>
  <pre>
  DBI1446I  The db2icrt command is running.
  
  
  DBI1070I  Program db2icrt completed successfully.
  
  
  (*) Fixing /etc/services file for DB2 ... 
  /bin/bash: db2stop: command not found
  </pre>
  <p>From what I could figure out, the presence of <code>(*) Fixing /etc/services file for DB2 ... </code> already seems to be wrong (since it does not appear in my intel log and does not sound like everything's fine) and the <code>/bin/bash: db2stop: command not found</code> appears due to line 81 of <code>/var/db2_setup/include/db2_common_functions</code>, which states <code>su - ${DB2INSTANCE?} -c 'db2stop force'</code>.
  As far as I understand, <code>su -</code> should run with the path of the target user. In every single <code>.profile</code> or <code>.bashrc</code> in the home directory, the <code>~/sqllib/db2profile</code> is being sourced (via <code>. /database/config/db2dude/sqllib/db2profile</code>).</p>
  <p>However, when as root inside of the container (<code>docker exec -it db2-test bash</code>), calling <code>su - db2dude -c 'echo $PATH'</code>, it prints <code>/usr/local/bin:/bin:/usr/bin</code>. Therefore, the PATH obviously is not as expected.</p>
  <p>Maybe someone can figure out, what's happening at this point. I also tried running Docker with &quot;new Virtualization framework&quot;, which did not change anything. I assume, Dockers compatibility magic might not be perfect, however I'm looking forward to find some kind of workaround, maybe by building an image upon <code>ibmcom/db2</code>.</p>
  <p>I highly appreciate your time and advice. Thanks a lot in advance.</p>