0

I am using the ACI connector in logic apps, and using a customized version of nginx docker image that keeps failing with "CrashLoopBackOff" error.

enter image description here

The customization I've made is just these two:

apt update
apt install ssh

and built a new image out of that. While using the base nginx image (from docker hub - library/nginx) works like a charm, the custom version with SSH installed, always gets into the loop with CrashLoopBackOff error.

I'm not a Linux/Ubuntu guy, any idea what could be the issue? I have in fact tried this many times and also used the Ubuntu base image to do the same customisation (install SSH), but the result is the same

Background: I am using ACI to run a simple shell script on creation. This probably doesn't have anything to do with the error since it works ok with the base nginx image.

enter image description here

Lalman
  • 946
  • 2
  • 11
  • 27

1 Answers1

0

To install the SSH in the image, you need to more than you have done. Here is the example:

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:THEPASSWORDYOUCREATED' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

When you have built the image, I suggest you push it into the ACR. Then you can use it in the Logic App and it will work fine. For more details, see Dockerize an SSH service.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39