0
I’m trying to run otrs on Docker and when I built dockerfile it restarts apache and closes the container.
Follow the Dockerfile file
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y wget
RUN apt-get install -y libapache2-mod-perl2 libdbd-mysql-perl libtimedate-perl libnet-dns-perl libnet-ldap-perl \
libio-socket-ssl-perl libpdf-api2-perl libdbd-mysql-perl libsoap-lite-perl libtext-csv-xs-perl \
libjson-xs-perl libapache-dbi-perl libxml-libxml-perl libxml-libxslt-perl libyaml-perl \
libarchive-zip-perl libcrypt-eksblowfish-perl libencode-hanextra-perl libmail-imapclient-perl \
libtemplate-perl
RUN wget http://ftp.otrs.org/pub/otrs/otrs-6.0.17.tar.gz
RUN tar xzf otrs-6.0.17.tar.gz
RUN mv otrs-6.0.17 /opt/otrs
RUN apt-get install -y libdatetime-perl && apt-get install -y libauthen-ntlm-perl && \
apt-get install -y libdbd-odbc-perl && \
apt-get install libdigest-md5-perl
RUN useradd -d /opt/otrs -c 'OTRS user' otrs
RUN usermod -G www-data otrs
RUN cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm
RUN apt-get install -y apache2 libapache2-mod-perl2
RUN ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-enabled/zzz_otrs.conf
RUN a2enmod perl deflate filter headers
CMD service apache2 restart
WORKDIR /opt/otrs/
RUN ./bin/otrs.SetPermissions.pl
EXPOSE 80
This means that the main application inside the container is faulty, closed and then Docker finishes it. Check the application log for details.
– Filipe L. Constante
I’ve gone over and over and over. :/
– teste
Docker will only persist while the
CMD
is running. When the command closes, Docker will also drop the created image. In this case, your image is dropped because the commandservice apache2 restart
is finished. To keep the image running you need to keep the main process running as well. For your case, keep Apache running in the foreground (foreground).– Woss
CMD apachectl-D FOREGROUND, worked, fought there...
– teste