0

I was using docker image ibmcom/mq . My compose file was:

FROM ibmcom/mq
USER root
# create another client user
# default is app without password
RUN useradd user1 -G mqclient && \
echo user1:passwd | chpasswd

Then suddenly it was stopped working when I build latest image again.

Error is :

useradd: group 'mqclient' does not exist
ERROR: Service 'mq' failed to build: The command '/bin/sh -c useradd user1 -G mqclient &&     echo user1:passwd | chpasswd' returned a non-zero code: 6

Now compose is not working with latest image(9.1.5.0-r1) version but works with old version e.g. 9.1.4.0-r1

Can anyone suggest what is the alternative

Jack
  • 193
  • 11
  • Make sure that you are using the latest image - ibmcom/mq:9.1.5.0-r1 if you are and the problem persists then please raise an issue against the GitHub repo for the image - https://github.com/ibm-messaging/mq-container – chughts Apr 24 '20 at 07:46
  • @chughts : This is what I mentioned in the question that latest image(9.1.5.0-r1) is giving me error. – Jack Apr 27 '20 at 08:22
  • I had expected an error to say that you need to be root (sudo) to run useradd, but the error you get implies that the group mqclient hasn't been created. Which is why I suggest you raise an issue against the GitHub repo for the image. – chughts Apr 27 '20 at 08:27
  • I have created an issue against there GitHub repo - https://github.com/ibm-messaging/mq-container/issues/400 – chughts May 05 '20 at 13:06

1 Answers1

3

From 9.1.5 the container does not use OS based users or groups. This is to conform to cloud best practices. Instead a file based system is being used. This is so that when you roll-out the container in a cloud into production you can switch to an LDAP based system.

The 9.1.5 container uses htpasswd, with the relevant file in /etc/mqm/

For development, if you are not going to create new users, then you can use the 9.1.5 container. If you want to create new users, then you can use 9.1.4 or earlier, or use htpasswd with bcrypt to create the users.

chughts
  • 4,210
  • 2
  • 14
  • 27