Skip to content

Commit

Permalink
docker file added. action builds and pushes the image
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Kausale committed Dec 2, 2024
1 parent 1624322 commit c146b18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/assignment1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Build docker image
run: docker build -t rahulkausale/hello-world:latest .

- name: Login to docker
run: docker login -u ${{ secrets.DUSERNAME }} -p ${{ secrets.DPASSWORD }}

- name: Push the image to docker registry
run: docker push rahulkausale/hello-world:latest
# # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM maven:3.8.5-openjdk-17
EXPOSE 8080
ADD target/spring-boot-2-hello-world-1.0.2-SNAPSHOT.jar app.jar

ENTRYPOINT exec java -jar -Djava.net.preferIPv4Stack=true app.jar

0 comments on commit c146b18

Please sign in to comment.