Skip to content

Commit

Permalink
Adds Dockerfile and build commands for it (#19)
Browse files Browse the repository at this point in the history
Docker support
  • Loading branch information
StrongestNumber9 authored Jan 10, 2024
1 parent f6a98bd commit 4eb266c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,18 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: rpm/target/rpm/com.teragrep-aer_01/RPMS/noarch/com.teragrep-aer_01-*.rpm

- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase repository name
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: 'Build Image'
run: |
docker buildx build --output type=docker --tag ghcr.io/${{ env.REPO_LC }}:${{ github.event.release.tag_name }} --tag ghcr.io/${{ env.REPO_LC }}:latest .
docker push ghcr.io/${{ env.REPO_LC }} --all-tags
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM rockylinux:8
COPY rpm/target/rpm/com.teragrep-aer_01/RPMS/noarch/com.teragrep-aer_01-*.rpm /rpm/
RUN dnf -y install /rpm/*.rpm && rm -f /dnf/*.rpm && dnf clean all
WORKDIR /opt/teragrep/aer_01
ENTRYPOINT [ "/usr/bin/java", "-Dconfig.source=environment", "-jar", "/opt/teragrep/aer_01/lib/aer_01.jar" ]
CMD [""]
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,13 @@
<exclude>.gitignore</exclude>
<exclude>.gitmodules</exclude>
<!-- ci -->
<exclude>.github/workflows/*.yml</exclude>
<exclude>.github/workflows/*.yaml</exclude>
<exclude>.github/**</exclude>
<!-- readme -->
<exclude>README.adoc</exclude>
<!-- logger configs -->
<exclude>**/log4j2.xml</exclude>
<!-- internal -->
<exclude>Jenkinsfile</exclude>
<!-- Docker -->
<exclude>Dockerfile</exclude>
<!-- rpm -->
<exclude>rpm/**</exclude>
</excludes>
Expand Down

0 comments on commit 4eb266c

Please sign in to comment.