Giter VIP home page Giter VIP logo

java_app_docker's Introduction

  1. mkdir java-application
  2. create a docker file named javaapp_mysql in directory java-application, for example

FROM java:8 WORKDIR / ADD DockerConnectMySQL.java / ADD mysql-connector-java-5.1.47-bin.jar / #extend environment classpath so that mysql connector may be used. ENV CLASSPATH=".:/mysql-connector-java-5.1.47-bin.jar:${CLASSPATH}" RUN javac DockerConnectMySQL.java EXPOSE 8080 CMD java DockerConnectMySQL

  1. docker build -f javaapp_mysql -t java_mysql . -f specifies the Dockerfile. This can be skipped if the filename used at the beginning of this process is Dockerfile.

-t specifies the name of the image. The name demo/oracle-java, and the 8 after the colon, specify the image tag. The tag 8 is used because we are using Java 8. This can be changed to any tag name that makes sense.

NOTE: Do not forget the .(dot) at the end of command;

  1. docker run java_mysql

java_app_docker's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.