I want to have a docker image which extends mongo image and have ssh on it. I wrote this lines :
FROM mongo
RUN apt-get update && \
apt-get install -y openssh-server
EXPOSE 22
RUN useradd -s /bin/bash -p $(openssl passwd -1 test) -d /home/nf2/ -m -G sudo test
CMD ["sh", "-c", "service ssh start", "bash"]
This starts only ssh and not mongo. If I remove the last line mongod is executed from the base image.
Any idea to run both commands in the same image ?