Skip to content

Commit

Permalink
Docker files examples
Browse files Browse the repository at this point in the history
  • Loading branch information
devopstrainingbanglore authored Jul 23, 2019
0 parents commit d7b6aaa
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu
RUN echo "Run One Updated"
RUN echo "RUN TWO"
CMD echo "Echo From Image"
CMD echo "Echo From Latest"
RUN echo "RUN Three"
7 changes: 7 additions & 0 deletions DockerfileOne
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu
RUN echo "Run One"
RUN echo "RUN TWO"
ENTRYPOINT ["echo","Hello From EP"]
CMD ["Echo From Image"]
CMD [" Echo From Latest"]
RUN echo "RUN Three"
2 changes: 2 additions & 0 deletions Dockerfile_CMD
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ubuntu
CMD ["echo" ,"FROM DockerFile"]
3 changes: 3 additions & 0 deletions Dockerfile_CMDENT
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu
CMD ["echo" ,"FROM DockerFile"]
ENTRYPOINT ["ls", "/"]
2 changes: 2 additions & 0 deletions Dockerfile_ENTRYPOINT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ubuntu
ENTRYPOINT ["echo" ,"FROM DockerFile"]
4 changes: 4 additions & 0 deletions Dockerfile_Tomcat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM tomcat:8.0.20-jre8
RUN sed -i '/<\/tomcat-users>/ i\<user username="admin" password="password" roles="admin-gui,manager-gui"/>' /usr/local/tomcat/conf/tomcat-users.xml
#COPY tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
COPY java-web-app.war /usr/local/tomcat/webapps/gradle-web-app.war
19 changes: 19 additions & 0 deletions Dockerfile_Tomcat_CentOs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM centos

MAINTAINER [email protected]

RUN mkdir /opt/tomcat/

WORKDIR /opt/tomcat
#RUN curl -O http://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.43/bin/apache-tomcat-8.5.43.tar.gz
ADD http://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.43/bin/apache-tomcat-8.5.43.tar.gz .
RUN tar xvfz apache*.tar.gz
RUN mv apache-tomcat-8.5.43/* /opt/tomcat/.
RUN yum -y install java
RUN java -version

WORKDIR /opt/tomcat/webapps

EXPOSE 8080

CMD ["/opt/tomcat/bin/catalina.sh", "run"]
9 changes: 9 additions & 0 deletions Dockerfile_Tomcat_Ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:latest
RUN apt-get -y update && apt-get -y upgrade \
&& apt-get -y install openjdk-8-jdk wget
RUN mkdir /usr/local/tomcat
RUN wget http://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.43/bin/apache-tomcat-8.5.43.tar.gz -O /tmp/tomcat.tar.gz
RUN cd /tmp && tar xvfz tomcat.tar.gz \
&& cp -Rv /tmp/apache-tomcat-8.5.43/* /usr/local/tomcat/
#EXPOSE 8080
CMD /usr/local/tomcat/bin/catalina.sh run
3 changes: 3 additions & 0 deletions Dockerfile_Wildfly
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM jboss/wildfly

ADD java-web-app.war /opt/jboss/wildfly/standalone/deployments/
5 changes: 5 additions & 0 deletions Dockerfile_Wildfly_Admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM jboss/wildfly

RUN /opt/jboss/wildfly/bin/add-user.sh admin password --silent

CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
2 changes: 2 additions & 0 deletions Dockerfile_nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello World</h1>
Binary file added java-web-app.war
Binary file not shown.
46 changes: 46 additions & 0 deletions tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->

<user username="admin" password="password" roles="admin-gui,manager-gui"/>
</tomcat-users>

0 comments on commit d7b6aaa

Please sign in to comment.