Docker container is getting exited Immediately

Hi Team,

We are trying to containerize the Gateway bridge, Network server & Application server as a single image.

We have followed the Linux installation guide and we have created the below docker file.

Docker File
FROM ubuntu:18.04
RUN apt-get -y update && apt-get install -y mosquitto && apt-get install -y mosquitto-clients && apt-get install -y redis-server && apt-get install -y redis-tools && apt-get install -y postgresql && apt-get install -y apt-transport-https dirmngr
RUN apt-key adv --keyserver --recv-keys 1CE2AFD36DBCCA00
RUN echo “deb Index of /packages/3.x/deb/ stable main” | tee /etc/apt/sources.list.d/chirpstack.list
RUN apt-get install --reinstall ca-certificates
RUN apt-get -y update
RUN apt-get install chirpstack-gateway-bridge
COPY ./chirpstack-gateway-bridge.toml /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml
RUN apt-get install chirpstack-network-server
COPY ./chirpstack-network-server.toml /etc/chirpstack-network-server/chirpstack-network-server.toml
RUN apt-get install chirpstack-application-server
COPY ./chirpstack-application-server.toml chirpstack-application-server/chirpstack-application-server.toml
USER postgres
*RUN /etc/init.d/postgresql start &&*
*psql --command “CREATE USER chirpstack_as WITH SUPERUSER PASSWORD ‘dbpassword’;” &&*
*createdb -O chirpstack_as chirpstack_as &&*
*psql --command “CREATE USER chirpstack_ns WITH SUPERUSER PASSWORD ‘dbpassword’;” &&*
*createdb -O chirpstack_ns chirpstack_ns &&*
*psql --command “\c chirpstack_as” &&*
*psql --command “create extension pg_trgm;” &&*
*psql --command “create extension hstore;” &&*
*psql --command “\q” *
EXPOSE 1700/udp
USER root
COPY ./ ./
RUN [“chmod”, “+x”, “./”]
CMD ./
/etc/init.d/chirpstack-gateway-bridge start
/etc/init.d/chirpstack-network-server start
sleep 5
tail -f -n 100 /var/log/chirpstack-network-server
/etc/init.d/chirpstack-application-server start

sudo docker build -t test4 .
Successfully built 6fc9559ae3ea
Successfully tagged test4:latest

sudo docker run 6fc9559ae3ea
Starting ChirpStack Gateway Bridge
Starting ChirpStack Network Server
tail: error reading ‘/var/log/chirpstack-network-server’: Is a directory
tail: /var/log/chirpstack-network-server: cannot follow end of this type of file; giving up on this name
tail: no files remaining
Starting ChirpStack Application Server

When we check the container status, its exited immediately.

Can any one please help us on this?

Thanks in Advance :slight_smile: .