Priyanka.Patil
Priyanka.Patil

Reputation: 1197

Docker run : Logs not displayed on the console

Following is the Dockerfile

FROM centos:centos6
MAINTAINER Priyanka

################## Helpful utils
RUN yum -y install sudo
RUN yum -y install curl
RUN yum -y install unzip

################## JDK7

#Note that ADD uncompresses this tarball automatically
ADD jdk-7u79-linux-x64.tar.gz /opt
WORKDIR /opt/jdk1.7.0_79
RUN alternatives --install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 1
RUN alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_79/bin/jar 1
RUN alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 1
RUN echo "JAVA_HOME=/opt/jdk1.7.0_79" >> /etc/environment
ENV JAVA_OPTS -Xms1024m -Xmx4196m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m

RUN curl -O http://10.113.57.164:8080/job/ROC4-Server-UT-enabled/ws/roc-server-bootstrap/target/bootstrap.zip
RUN unzip bootstrap.zip -d /usr/share/server
RUN chmod +x /usr/share/server/bootstrap/bin/bootstrap.sh
CMD ["/usr/share/server/bootstrap/bin/bootstrap.sh","run"]

Following are the docker commands used :

docker build -t serdock9 .

docker run -v /priyanka_docker/configserver.properties:/usr/share/server/bootstrap/config/configserver.properties serdock9 /bin/bash

Docker build is running successfully. When I execute Docker run, the command executes,but does not show any logs on the console. Where as, the same bootstrap.sh when i run on manually shows a set of logs. Any idea as to what should be updated for the logs to show up as I'm not being able to determine the status of Docker run without them.

Upvotes: 0

Views: 4452

Answers (1)

user2915097
user2915097

Reputation: 32156

as your Dockerfile has a line

CMD ["/usr/share/server/bootstrap/bin/bootstrap.sh","run"]

this means that a

docker run -v aaa:bbb serdock9

will launch this script

when you launch

docker run -v aaa:bbb serdock9 /bin/bash

you replace your CMD by /bin/bash, which does not display anything

see also

https://hub.docker.com/r/k3ck3c/nethogs/

extract

I define an alias alias nethogs='docker run -it --net=host --rm k3ck3c/nethogs' so just nethogs will monitor wlan0 and nethogs eth0 will monitor eth0 (or accordingly ra1, or...)

Upvotes: 1

Related Questions