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

Dockerfile maven - Parameterize microservice's JAR file name. Upgrade Spotify Dockerfile's maven plugin version #4

Open
wants to merge 4 commits into
base: DOCKERFILE-MAVEN
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ env:
- TMX_DOCKER_IMAGE=johncarnell/tmx-simple-service:chapter1
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- mvn clean package docker:build
- mvn clean package
- docker push $TMX_DOCKER_IMAGE
- ecs-cli --version
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To build the code examples for Chapter 1 as a docker image, open a command-line

Run the following maven command. This command will execute the [Spotify docker plugin](https://github.com/spotify/docker-maven-plugin) defined in the pom.xml file.

**mvn clean package docker:build**
**mvn clean package**

If everything builds successfully you should see a message indicating that the build was successful.

Expand Down
3 changes: 2 additions & 1 deletion simpleservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM openjdk:8-jdk-alpine
RUN apk update && apk upgrade && apk add netcat-openbsd
RUN mkdir -p /usr/local/simple-service

ADD target/simple-service-0.0.1-SNAPSHOT.jar /usr/local/simple-service
ARG JAR_FILE
ADD target/${JAR_FILE} /usr/local/simple-service
ADD src/main/docker/run.sh run.sh
RUN chmod +x run.sh
CMD ./run.sh
5 changes: 4 additions & 1 deletion simpleservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.4</version>
<version>1.3.7</version>
<executions>
<execution>
<id>default</id>
Expand All @@ -59,6 +59,9 @@
<configuration>
<repository>${docker.image.name}</repository>
<tag>${docker.image.tag}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</execution>
</executions>
Expand Down