Docker Community Forums

Share and learn in the Docker community.

Db2 image - db2start failing for non-root user

Hi All,

I am trying to deploy db2 image along with my script which help to create tables after db2 engine started using db2start

Dockerfile:

from db2image/10…

RUN usermod -a -G wheel db2inst1 &&
su - db2inst1 -c ‘db2start &&
sqlscript.sh’

CMD [“db2start”]

The above script works fine in my local setup.

But when deploying to cloud I am getting privilege’s access exception as wheel group is not supported in cloud due to security limitation.


I am trying to modify dockerfile without su - command.

Getting exception message “db2start command not found” when executed below cmd. Can you help to correct my scripts…

Dockerfile:

from db2image/10…

USER db2inst1

RUN “abc.sh”

CMD [“db2start”]

abc.sh:
#!/bin/bash
cd /home/db2inst1/
db2start
sqlscript.sh