So I have the Dockerfile
FROM rust:1.19.0
RUN set -x \
&& apt-get update \
&& apt-get install git
RUN git clone https://gitlab.localhost.com/iron-site.git \
&& cd ./iron-site \
&& cargo build --all \
&& cp ./target/debug/*-site /usr/local/bin \
&& cd .. \
&& rm -rf iron-site
From nginx
COPY --from=0 /usr/local/bin/*-site /usr/local/bin/
ENV DATABASE_INI_FILE /srv/test.ini
COPY nginx.conf /etc/nginx/nginx.conf
COPY test.ini /srv/
COPY start.sh /usr/local/bin/
RUN chmod 770 /usr/local/bin/start.sh
RUN echo ls -la /usr/local/bin/
CMD /usr/local/bin/start.sh
So in essence the first stage builds some rust binaries when executed will generate unix sockets. The second stage just runs those binaries with a nginx instance that proxies the http requests to the correct unix socket. When I build everything works no errors are produced. However, when I run sudo docker run site-image
where site-image is the tag for the image I get nothing. No output or errors and no container so I am confused as to how I could debug the issue further and or resolve the issue.
Lastly, my OS is fedora 27 and the docker version is 17.12.0-ce
The start.sh script is as follows:
#!/bin/bash
rm -f /run/nginx.pid
nginx -t
site_names=( $(find /usr/local/bin -name '*-site' | cut -d '/' -f5) )
for site in ${site_names[@]}; do
/usr/local/bin/$site -p /run/nginx/$site.sock -x 1024
done
nginx -g daemon off