Compare commits

...

16 Commits

Author SHA1 Message Date
veronoicc 2bd3cd5cd1
Merge edd8b94d00 into 8600180f30 2024-05-16 14:06:11 +02:00
RaphiMC 8600180f30
Merge remote-tracking branch 'origin/main' 2024-05-16 14:06:00 +02:00
RaphiMC a851c34d1d
Added toolchain resolving plugin 2024-05-16 14:05:46 +02:00
veronoicc edd8b94d00 Only build container image on push to main 2024-05-14 17:24:16 +02:00
veronoicc 598b1b2986 Add newline at the end of docker workflow 2024-05-14 17:24:00 +02:00
veronoicc d55509a9db 17? 2024-05-14 10:30:13 +02:00
veronoicc 4319a34163 Remove chown's cuz not needed 2024-05-14 10:25:37 +02:00
veronoicc 0b3e6e5fc8 That wasn't the problem, copy .git now 2024-05-14 10:23:58 +02:00
veronoicc 6466957dc9 Install git in image 2024-05-14 10:22:30 +02:00
veronoicc b01ab5efca nvm 21 it is 2024-05-14 10:18:41 +02:00
veronoicc f2ab9630e8 Try using java 22 2024-05-14 10:17:25 +02:00
veronoicc ecb0a84c42 Switch to eclipse temurin for run image 2024-05-14 10:11:25 +02:00
veronoicc 9450bd24a7 Fix naming of builder layer 2024-05-14 10:09:13 +02:00
veronoicc 875c95885a Make the image be tagged with commit sha and latest 2024-05-14 10:06:57 +02:00
veronoicc caf18da694 Add Docker build workflow 2024-05-14 10:03:22 +02:00
veronoicc b6b63a6c6d Add Dockerfile 2024-05-14 10:01:47 +02:00
3 changed files with 57 additions and 0 deletions

42
.github/workflows/build-docker.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: build-docker
on:
workflow_dispatch:
push:
branches:
- main
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=latest
type=sha
images: ${{ env.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM --platform=$BUILDPLATFORM gradle:jdk17 as builder
WORKDIR /build
COPY build.gradle settings.gradle gradle.properties ./
COPY .git .git
COPY src src
RUN gradle --no-daemon build
FROM --platform=$TARGETPLATFORM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=builder /build/build/libs/ViaProxy-*.jar ViaProxy.jar
ENTRYPOINT ["java", "-jar", "ViaProxy.jar"]

View File

@ -9,4 +9,8 @@ pluginManagement {
}
}
plugins {
id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0"
}
rootProject.name = "ViaProxy"