Я не могу создать образ Docker с DB2.
Dockerfile:
FROM ibmcom/db2express-c
EXPOSE 50000
CMD ["db2start"]
SHELL ["/bin/bash", "-c"]
RUN su - db2inst1 -c "db2 create db DMX"
Войти:
Building image...
Step 1/5 : FROM ibmcom/db2express-c
---> 7aa154d9b73c
Step 2/5 : EXPOSE 50000
---> Using cache
---> 3172f8b3790b
Step 3/5 : CMD ["db2start"]
---> Using cache
---> f38e27452920
Step 4/5 : SHELL ["/bin/bash", "-c"]
---> Using cache
---> 1cef61dbf3c5
Step 5/5 : RUN su - db2inst1 -c "db2 create db DMX"
---> Running in 59b7a5d1c0ba
DB21018E A system error occurred. The command line processor could not
continue processing.
Error: ResponseItem.ErrorDetail[code=8,message=The command '/bin/bash -c su
- db2inst1 -c "db2 create db DMX"' returned a non-zero code: 8]
Но если я выполню su - db2inst1 -c "db2 create db DMX"
вручную, это сработает:
MB-54:test mkadan$ docker exec -i -t db2 /bin/bash
[root@5cb934e6d434 /]# su - db2inst1 -c "db2 create db DMX"
DB20000I The CREATE DATABASE command completed successfully.
Любой намек, в чем здесь проблема?