Hello Guys,
I want to run simple nodejs hello world example using docker on CentOS7. Could you please give me some suggestion for that.
I run hello world example but it seems like it is not working properly.
Here is my Docker file for Nodejs Hello world demo
FROM ubuntu:14.04
MAINTAINER xxx <
xxx...@gmail.com>
RUN sudo apt-get install curl -y
RUN curl -sL
https://deb.nodesource.com/setup | sudo bash -
RUN sudo apt-get install -y nodejs
RUN sudo npm install -g bower
RUN npm -g install npm@latest
RUN sudo apt-get install git -y
# Install app dependencies
COPY package.json /src/package.json
RUN cd /src; npm install --production
# Bundle app source
COPY . /src
#RUN sudo npm install
EXPOSE 8080
CMD ["node", "/src/server.js"]
#ENTRYPOINT ["/usr/bin/kurento-media-server"]
Below is the result when i build the docker container
[root@localhost kurento-hello-world]# docker build -t helloworldnodejs .
Sending build context to Docker daemon 223.7 kB
Step 1 : FROM ubuntu:14.04
---> 07c86167cdc4
Step 2 : MAINTAINER xxx <
xxx...@gmail.com>
---> Using cache
---> addd2759f7a9
Step 3 : RUN sudo apt-get install curl -y
---> Using cache
---> 496275e824a3
Step 4 : RUN curl -sL
https://deb.nodesource.com/setup | sudo bash -
---> Using cache
---> 56a567cf65ca
Step 5 : RUN sudo apt-get install -y nodejs
---> Using cache
---> 7aa5429e1ad6
Step 6 : RUN sudo npm install -g bower
---> Using cache
---> 5850c1ee855c
Step 7 : RUN npm -g install npm@latest
---> Using cache
---> 2ad6d205c3bc
Step 8 : RUN sudo apt-get install git -y
---> Using cache
---> 2c0868360489
Step 9 : COPY package.json /src/package.json
---> Using cache
---> a6c39bdb327a
Step 10 : RUN cd /src; npm install --production
---> Using cache
---> adaf195f58d8
Step 11 : COPY . /src
---> Using cache
---> 60fa5bf3a1d3
Step 12 : EXPOSE 8080
---> Using cache
---> a55c9ef73d87
Step 13 : CMD node /src/server.js
---> Using cache
---> 6c2516d05840
Successfully built 6c2516d05840
[root@localhost kurento-hello-world]#
With the help below command I run the demo
docker run -p 8443:8080 -d helloworldnodejs
but it gives me following result.. It is exited
root@localhost kurento-hello-world]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
118fc6a1b833 helloworldnodejs "node /src/server.js" 3 seconds ago Exited (8) 1 seconds ago
Could you please give me any suggestion for this?
I am new to the Docker Hub.
Also I run the Kurento Media Server 6 (separate file )
It's Dockerfile is
# kurento-media-server
#
# VERSION 6.2.0
FROM ubuntu:14.04
MAINTAINER xxx <
xxx...@gmail.com>
RUN echo "deb
http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
RUN sudo apt-get install wget -y
RUN wget -O -
http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
RUN sudo apt-get update -y
RUN sudo apt-get install kurento-media-server-6.0 -y
EXPOSE 8888
#COPY ./entrypoint.sh /entrypoint.sh
#ENV GST_DEBUG=Kurento*:5
#ENTRYPOINT ["/entrypoint.sh"]
RUN sudo service kurento-media-server-6.0 start
#ENTRYPOINT ["/usr/bin/kurento-media-server"]
It is also successfully built
[root@localhost kurento-media-server]# docker build -t kurento_media_server .
Sending build context to Docker daemon 4.096 kB
Step 1 : FROM ubuntu:14.04
---> 07c86167cdc4
Step 2 : MAINTAINER xxx <
xxx...@gmail.com>
---> Using cache
---> addd2759f7a9
Step 3 : RUN echo "deb
http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
---> Using cache
---> 1112ea75df17
Step 4 : RUN sudo apt-get install wget -y
---> Using cache
---> 38bd206f3eaf
Step 5 : RUN wget -O -
http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
---> Using cache
---> 063d9294e507
Step 6 : RUN sudo apt-get update -y
---> Using cache
---> fab30b06a107
Step 7 : RUN sudo apt-get install kurento-media-server-6.0 -y
---> Using cache
---> 088344cc1d6f
Step 8 : EXPOSE 8888
---> Using cache
---> 31e7443598d2
Step 9 : RUN sudo service kurento-media-server-6.0 start
---> Using cache
---> e7f84bf1a1b5
Successfully built e7f84bf1a1b5
[root@localhost kurento-media-server]#
But it is not running when I run the docker container.
75af7110b722 kurento_media_server "/bin/bash" 46 minutes ago Exited (0) 46 minutes ago evil_aryabhata
I have some questions
What am I missing?
Is there any working example of nodejs demo using Docker engine
How to install KMS6 on Centos7 using Docker?
Any suggestion would be appreciated.
Thank you.