I'm trying to start the db2 express docker image in a Bluemix container. If I follow the recommended commanded to start the container as a daemon, I get the following error su: cannot create child process: Resource temporarily unavailable
. This is because the container attempts to run su - db2inst1 -c "db2start"
in the entrypoint script. The troubleshooting guide recommends that I modify /etc/pam.d
BUT I am unable to modify this file since the container is not running. I've tried a few solutions to start the container, but I have not found anything yet that works.
- I tried modifying the entrypoint of the container in the cf ic run...
command but this does not seem to be a feature of the plugin
- I tried starting the container with cat
as the command rather than db2start
but the container does not continue running after the entrypoint script.
Any help would be appreciated.
Answer by Jacob Garcowski (459) | May 27, 2016 at 02:48 PM
Use the following Dockerfile to make an image that has a modified /etc/pam.d/su
FROM ibmcom/db2express-c:latest
RUN sed -i 's/session.*include/session optional/' /etc/pam.d/su
I confirmed I could then run this in the new infrastructure. Below is the output I get from the cf ic logs command:
%Changing password for user db2inst1.
8passwd: all authentication tokens updated successfully.
.SQL1063N DB2START processing was successful.
4Could not load host key: /etc/ssh/ssh_host_rsa_key
6Could not load host key: /etc/ssh/ssh_host_ecdsa_key
8Could not load host key: /etc/ssh/ssh_host_ed25519_key
Thanks for the response, but when I run the command
cf ic run -p 50000:50000 -e DB2INST1_PASSWORD=xxxxxxxxxx -e LICENSE=accept namespace/db2express-c db2start
i get the following from my cf ic logs command:
```$ cf ic logs container %Changing password for user db2inst1. 8passwd: all authentication tokens updated successfully. eNew password: Retype new password: su: cannot create child process: Resource temporarily unavailable ```
the docker image comes from the command: cf ic cpi ibmcom/db2express-c <registry-name>/db2:latest
and the upgrade to the container space is denoted by the command: cf ic info
... Environment Name : prod-dal09-kraken1
... i was told by the container team that "kraken1" was the new space, before I was on "vizio3"
so, it looks like something about my environment is different than yours. did you do something special to modify your default user permissions?
Just to clarify, I didn't just copy the image, I built a new one with a Dockerfile, so cf ic cpi won't work.
Create a new directory create a Dockerfile with the following in it:
FROM ibmcom/db2express-c:latest
RUN sed -i 's/session.*include/session optional/' /etc/pam.d/su
Then run from that directory
cf ic build -t db2sufix .
Then you should be able to do the following (replacing your namespace and DB2INST1_PASSWORD of preference)
cf ic run -p 50000:50000 -e DB2INST1_PASSWORD=xxxxxxxxxxx -e LICENSE=accept namespace/db2sufix db2start
Note: I answered earlier before properly switching to kraken, so there is a chance you read an early edit of my answer without the Dockerfile information.
building the docker file with the above Dockerfile in the cwd worked. thanks a million!