Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Docker woe's!
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Docker woe's!

jeromezajeromeza Member
edited March 2016 in General

I'm playing around with docker and i'm noticing a weird issue. When I run my container and specify the entrypoint script it runs fine.

root@sd-34204 ~]# docker run --interactive --tty --entrypoint=/entrypoint.sh  jeromeza/znc
[ .. ] Checking for list of available modules...
[ >> ] ok
[ .. ] Opening config [/znc-data/configs/znc.conf]...
[ >> ] ok
[ .. ] Loading global module [webadmin]...
[ >> ] [/usr/local/lib/znc/webadmin.so]
[ .. ] Binding to port [6667]...
[ >> ] ok
[ ** ] Loading user [admin]
[ .. ] Loading user module [chansaver]...
[ >> ] ok
[ .. ] Loading user module [controlpanel]...
[ >> ] ok
[ .. ] Loading user module [perform]...
[ >> ] ok
[ ** ] Staying open for debugging [pid: 8]
[ ** ] ZNC 1.6.1 - http://znc.in

BUT

When I run the container I see it adds a SPACE after the script name and then fails and exits...

[root@sd-34204 ~]# docker run -d -p 6667 -v $HOME/.znc:/znc-data jeromeza/znc
257dc47ac61f3ccfb1e3d7fb4aeea93350acfe6da32d94b3af62a193b0c8067b
[root@sd-34204 ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
257dc47ac61f        jeromeza/znc        "/entrypoint.sh "   7 seconds ago       Exited (1) 5 seconds ago                        cocky_sinoussi

For the life of me I can't figure out why!

Here's my Dockerfile

[root@sd-34204 docker-znc]# cat Dockerfile
# version 1.6.1-1
# docker-version 1.8.2
FROM docker.io/centos
MAINTAINER Jerome

ENV ZNC_VERSION 1.6.1

RUN yum update -y \
    && yum install gcc openssl openssl-devel wget sudo -y \
    && yum group install "Development Tools" -y \
    && mkdir -p /src \
    && cd /src \
    && wget "http://znc.in/releases/archive/znc-${ZNC_VERSION}.tar.gz" \
    && tar -zxf "znc-${ZNC_VERSION}.tar.gz" \
    && cd "znc-${ZNC_VERSION}" \
    && ./configure \
    && make \
    && make install \
    && yum clean all \
    && rm -rf /src* /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN useradd znc
ADD docker-entrypoint.sh /entrypoint.sh
ADD znc.conf.default /znc.conf.default
RUN chmod 644 /znc.conf.default

VOLUME /znc-data

EXPOSE 6667
ENTRYPOINT ["/entrypoint.sh"]
CMD [""]

Comments

  • Interestingly enough if I run the container with the -v flag it exits on start, if i use -tv it doesn't. Any idea why?

    [root@sd-34204 moddata]# docker run -d -p 6667 -v $HOME/.znc:/znc-data jeromeza/znc
    831d2eea9d1eb88459772e33c55c31cf2ddfcf4e0edbdc94e123c38d51a80fca
    [root@sd-34204 moddata]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
    831d2eea9d1e        jeromeza/znc        "/entrypoint.sh "   5 seconds ago       Exited (1) 4 seconds ago                       trusting_goldstine
    [root@sd-34204 moddata]# docker run -d -p 6667 -vt $HOME/.znc:/znc-data jeromeza/znc
    3d68161681659684890c54e615b8dd229f5bfa750f2ea5c4d2900e40eb5ed4f2
    [root@sd-34204 moddata]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS                     NAMES
    3d6816168165        jeromeza/znc        "/entrypoint.sh "   2 seconds ago       Up 1 seconds                0.0.0.0:32778->6667/tcp   agitated_panini
    831d2eea9d1e        jeromeza/znc        "/entrypoint.sh "   15 seconds ago      Exited (1) 14 seconds ago                             trusting_goldstine
    
  • jeromezajeromeza Member
    edited March 2016

    The next issue is why it's not surviving a reboot... Somehow it's getting a SIG 15... Any idea's?

    [root@sd-34204 ~]# docker run -d -p 6667 -vt $HOME/.znc:/znc-data jeromeza/znc
    2067cfcf216d7cad77393e94389c5cc3a05c3bc4a31cf7170552c342fd4b0eaf
    [root@sd-34204 ~]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                     NAMES
    2067cfcf216d        jeromeza/znc        "/entrypoint.sh "   3 seconds ago       Up 1 seconds        0.0.0.0:32768->6667/tcp   adoring_raman
    [root@sd-34204 ~]# docker logs 2067cfcf216d
    [ .. ] Checking for list of available modules...
    [ >> ] ok
    [ .. ] Opening config [/znc-data/configs/znc.conf]...
    [ >> ] ok
    [ .. ] Loading global module [webadmin]...
    [ >> ] [/usr/local/lib/znc/webadmin.so]
    [ .. ] Binding to port [6667]...
    [ >> ] ok
    [ ** ] Loading user [admin]
    [ .. ] Loading user module [chansaver]...
    [ >> ] ok
    [ .. ] Loading user module [controlpanel]...
    [ >> ] ok
    [ .. ] Loading user module [perform]...
    [ >> ] ok
    [ ** ] Staying open for debugging [pid: 6]
    [ ** ] ZNC 1.6.1 - http://znc.in
    
    [root@sd-34204 ~]# reboot
    
    [root@sd-34204 ~]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
    2067cfcf216d        jeromeza/znc        "/entrypoint.sh "   3 minutes ago       Exited (15) 2 minutes ago                       adoring_raman
    
    [root@sd-34204 ~]# docker logs 2067cfcf216d
    [ .. ] Checking for list of available modules...
    [ >> ] ok
    [ .. ] Opening config [/znc-data/configs/znc.conf]...
    [ >> ] ok
    [ .. ] Loading global module [webadmin]...
    [ >> ] [/usr/local/lib/znc/webadmin.so]
    [ .. ] Binding to port [6667]...
    [ >> ] ok
    [ ** ] Loading user [admin]
    [ .. ] Loading user module [chansaver]...
    [ >> ] ok
    [ .. ] Loading user module [controlpanel]...
    [ >> ] ok
    [ .. ] Loading user module [perform]...
    [ >> ] ok
    [ ** ] Staying open for debugging [pid: 6]
    [ ** ] ZNC 1.6.1 - http://znc.in
    [ ** ] Exiting on SIG [15]
    
  • david_Wdavid_W Member
    edited March 2016

    What's in your entrypoint script?

  • @jaromeza

    Try to remove the CMD [""] line and rebuild the image.

Sign In or Register to comment.