[olug] Docker + xinetd??
Jeff Hinrichs - DM&T
jeffh at dundeemt.com
Tue Jun 19 07:10:41 CDT 2018
+1 supervisord http://supervisord.org/
On Mon, Jun 18, 2018 at 2:14 PM, Jay Bendon <jaybocc2 at gmail.com> wrote:
> generally, you don't need a process manager for docker since docker can
> restart on process termination. If you want to pass stdin maybe do it via
> a file?
>
> Otherwise i've had lots of success using supervisord.
>
> Also you're using entry point wrong. Entry point should be a shell script
> that takes "arguments" and runs them
>
> # Entrypoint.sh
> #!/bin/bash
>
> echo "do some setup"
> exec "$@"
>
>
> ####
> You're really looking for is CMD which is passed into ENTRYPOINT
> CMD ["xinetd", "-f", "/etc/xinetd.conf", "-dontfork", "-inetd_compat"]
>
> --Jay
>
> On Mon, Jun 18, 2018 at 10:52 AM, Chad Homan <choman at gmail.com> wrote:
>
> > try taking a look at tini (google docker tini)
> >
> > I've heard of another (I think dumb-init)
> >
> > good luck
> >
> > Together We Win! Looking for cloud storage, try pCloud
> > <https://my.pcloud.com/#page=register&invite=O7KbZIt0T67> (10g free
> > <https://my.pcloud.com/#page=register&invite=O7KbZIt0T67>)
> > --
> > Chad
> >
> > Some people, when confronted with a problem, think "I know, I'll use
> > Windows."
> > Now they have two problems.
> >
> > Some people claim if you play a Windows Install Disc backwards you'll
> hear
> > satanic Messages.
> > That's nothing, if you play it forward it installs Windows
> >
> > On Mon, Jun 18, 2018 at 10:26 AM, Justin Reiners <justin at hotlinesinc.com
> >
> > wrote:
> >
> > > It didn't hang until I add xinetd into the mix.
> > >
> > >
> > >
> > > On Mon, Jun 18, 2018, 9:56 AM Rob Townley <rob.townley at gmail.com>
> wrote:
> > >
> > > > Have you tried taking out the inetd part and seeing if it still
> hangs?
> > > >
> > > > On Mon, Jun 18, 2018 at 9:37 AM Justin Reiners <
> justin at hotlinesinc.com
> > >
> > > > wrote:
> > > >
> > > > > Sorry to bother, maybe someone here knows.
> > > > >
> > > > > Has only had luck running xinetd within docker? I've got some older
> > > > legacy
> > > > > stuff written in python, which takes input on stdin I use xinetd to
> > > > > operate. I've been trying and failing for about 2 days now...
> > > > >
> > > > > I appreciate any ideas on why the entry point doesn't seem to work,
> > the
> > > > > docker instance seems to hang.
> > > > >
> > > > > Searching for "xinetd + docker" seems to be a lost cause.
> > > > >
> > > > >
> > > > > *Dockerfile:*
> > > > > From centos
> > > > > RUN yum -y update
> > > > > RUN yum -y install wget vim tar epel-release git nc xinetd tree
> > libcurl
> > > > > curl gcc-devel && yum -y install python34 python34-mysql
> > > python34-devel
> > > > > python34-pip openssl-devel libssl-devel && yum groupinstall -y
> > > > "Development
> > > > > Tools"
> > > > > RUN mkdir -p /app/bin && cd /app/bin
> > > > > COPY robocall.txt /etc/xinetd.d/robocall
> > > > > ENV PATH=$PATH:/app/bin/
> > > > > ENV GOOGLE_APPLICATIONS_CREDENTIALS=/app/bin/json.key
> > > > > COPY * /app/bin/
> > > > > RUN python3 -m pip install -r /app/bin/req2.txt
> > > > >
> > > > > ENTRYPOINT xinetd -f /etc/xinetd.conf -dontfork -inetd_compat
> > > > >
> > > > >
> > > > >
> > > > > *docker-compose.yml*:
> > > > > version: '2.2'
> > > > >
> > > > > services:
> > > > >
> > > > > robocaller:
> > > > > build: .
> > > > > restart: always
> > > > > privileged: True
> > > > > ports:
> > > > > - 2001:2001
> > > > >
> > > > >
> > > > > xinetd service file:
> > > > >
> > > > > service robocall
> > > > > {
> > > > > disable = no
> > > > > port = 2001
> > > > > flags = REUSE
> > > > > socket_type = stream
> > > > > protocol = tcp
> > > > > wait = no
> > > > > user = root
> > > > > server = python3 /app/bin/robocall.py
> > > > > }
> > > > >
> > > > >
> > > > > [09:34 root at server .../compose_files/robocaller (master *+%)]#
> > > > > docker-compose up
> > > > > Starting robocaller_robocaller_1 ...
> > > > > Starting robocaller_robocaller_1 ... done
> > > > > Attaching to robocaller_robocaller_1
> > > > > (hangs here)
> > > > >
> > > > >
> > > > > logs:
> > > > > [09:35 root at server .../compose_files/robocaller (master *+%)]#
> > docker
> > > > logs
> > > > > robocaller_robocaller_1
> > > > >
> > > > > (none)
> > > > > _______________________________________________
> > > > > OLUG mailing list
> > > > > OLUG at olug.org
> > > > > https://www.olug.org/mailman/listinfo/olug
> > > > >
> > > > _______________________________________________
> > > > OLUG mailing list
> > > > OLUG at olug.org
> > > > https://www.olug.org/mailman/listinfo/olug
> > > >
> > > _______________________________________________
> > > OLUG mailing list
> > > OLUG at olug.org
> > > https://www.olug.org/mailman/listinfo/olug
> > >
> > _______________________________________________
> > OLUG mailing list
> > OLUG at olug.org
> > https://www.olug.org/mailman/listinfo/olug
> >
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> https://www.olug.org/mailman/listinfo/olug
>
--
Best,
Jeff Hinrichs
402.218.1473
More information about the OLUG
mailing list