From a01a4131a63d59cfee908bdad28e24d404d6fe1e Mon Sep 17 00:00:00 2001 From: Strongest Number 9 <16169054+StrongestNumber9@users.noreply.github.com> Date: Wed, 17 May 2023 19:43:14 +0300 Subject: [PATCH] Build and publish ghcr docker image (#5) --- .github/workflows/upload_release.yaml | 17 +++++++++++++++++ Dockerfile | 7 +++++++ etc/config.json | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.github/workflows/upload_release.yaml b/.github/workflows/upload_release.yaml index 7fa3a23..02de0f6 100644 --- a/.github/workflows/upload_release.yaml +++ b/.github/workflows/upload_release.yaml @@ -58,3 +58,20 @@ jobs: with: files: rpm/target/rpm/com.teragrep-k8s_01/RPMS/noarch/com.teragrep-k8s_01-*.noarch.rpm + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - 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 }}/app:${{ github.event.release.tag_name }} . + docker push ghcr.io/${{ env.REPO_LC }}/app:${{ github.event.release.tag_name }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b713e25 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM rockylinux:8 +COPY rpm/target/rpm/com.teragrep-k8s_01/RPMS/noarch/com.teragrep-k8s_01-*.rpm /rpm/ +RUN dnf -y install jq java-1.8.0-headless /rpm/*.rpm && yum clean all +VOLUME /opt/teragrep/k8s_01/var +VOLUME /opt/teragrep/k8s_01/etc +WORKDIR /opt/teragrep/k8s_01 +ENTRYPOINT [ "/usr/bin/java", "-jar", "lib/k8s_01.jar" ] diff --git a/etc/config.json b/etc/config.json index f4fd2f4..5f5b57d 100644 --- a/etc/config.json +++ b/etc/config.json @@ -1,6 +1,6 @@ { "kubernetes": { - "logdir": "testlogs", + "logdir": "/var/log/containers", "url": "https://127.0.0.1:8443", "cacheExpireInterval": 900, "cacheMaxEntries": 4096,