Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify docker build. Just docker build . #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM maven:3-jdk-8 as build
WORKDIR /app

COPY pom.xml .

# Run maven build & remove artifacts to cache downloaded dependencies until pom.xml changes
RUN mvn clean package -Dmaven.main.skip -Dmaven.test.skip && rm -r target

# Copy all files with extensions (i.e. skip Dockerfile, Makefile)
COPY *.* ./

# Build for real
RUN mvn clean package -Dmaven.test.skip

FROM java:8

LABEL maintainer="Miguel Garcia Puyol <[email protected]>"

WORKDIR /var/app

COPY --from=build /app/target/zkui-*-jar-with-dependencies.jar /var/app/zkui.jar
ADD config.cfg /var/app/config.cfg
ADD bootstrap.sh /var/app/bootstrap.sh

ENTRYPOINT ["/var/app/bootstrap.sh"]

EXPOSE 9090
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ VERSION=2.0-SNAPSHOT
all: build publish

build:
mvn clean install
cp config.cfg docker
cp target/$(NAME)-*-jar-with-dependencies.jar docker
docker build -t $(NAME):$(VERSION) --no-cache --rm docker
rm docker/$(NAME)-*.jar
rm docker/config.cfg
docker build -t $(NAME):$(VERSION) .

publish:
docker tag $(NAME):$(VERSION) $(NAME):$(VERSION)
Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions docker/Dockerfile

This file was deleted.