Giter Site home page Giter Site logo

docker-java-multistage's Introduction

Multi-stage Docker Build for Java Applications

This repository shows how to create a multi-stage Docker build for Java application.

Single-stage

  1. Build: docker image build -f Dockerfile.single -t people:singlestage .

  2. Run: docker container run -it -p 8080:8080 people:singlestage

  3. Access: curl http://localhost:8080/people/resources/persons

Multi-stage

  1. Build: docker image build -f Dockerfile -t people:multistage .

  2. Run: docker container run -it -p 8080:8080 people:multistage

  3. Access: curl http://localhost:8080/people/resources/persons

docker-java-multistage's People

Contributors

arun-gupta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-java-multistage's Issues

Mounting local Maven Repo

First thanks for this example.
I was just wondering whether you see a possibility to specify an existing local Maven repository which could be used for the build. This way not all artifacts have to be downloaded every time during a build (considering one would have a application with more dependencies).
Thanks,
Thorsten

"maven:3.5-jdk-8 as BUILD" is not a valid repository/tag

I ran:

docker image build -f Dockerfile -t people:multistage .

and got:
Sending build context to Docker daemon 164.9 kB
Step 1/6 : FROM maven:3.5-jdk-8 as BUILD
Error parsing reference: "maven:3.5-jdk-8 as BUILD" is not a valid repository/tag: invalid reference format

Here is my docker version:

docker --version

Docker version 17.03.1-ce, build c6d412e

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.