Skip to content

Commit a5a1b3e

Browse files
committed
Added Dockerfile for easier multi arch image build
1 parent 2bf5a26 commit a5a1b3e

File tree

5 files changed

+19
-58
lines changed

5 files changed

+19
-58
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ jobs:
2929
distribution: 'liberica'
3030
java-version: '21'
3131

32-
- name: Get Maven version
32+
- name: Get Maven project version
3333
run: |
3434
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
3535
echo "Project Maven Version: $VERSION"
3636
echo "VERSION=$VERSION" >> $GITHUB_ENV
3737
38-
- name: Build with Maven
39-
run: mvn spring-boot:build-image -DskipTests
38+
- name: Build JAR with Maven
39+
run: mvn clean package -DskipTests
4040

41-
- name: Push Docker image
42-
run: docker push tutorialwork/kleinanzeigen-ads-renewer:${{ env.VERSION }}
41+
- name: Build & Push Multi Arch Docker Image
42+
run: |
43+
docker buildx build --platform linux/amd64,linux/arm64 \
44+
-t tutorialwork/kleinanzeigen-ads-renewer:${{ env.VERSION }} \
45+
-t tutorialwork/kleinanzeigen-ads-renewer:latest \
46+
--push .

.github/workflows/deploy_x86.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM eclipse-temurin:21-jre-ubi9-minimal
2+
3+
WORKDIR /var/lib/kleinanzeigen-ads-renewer
4+
5+
ADD target/kleinanzeigen-ads-renewer-*.jar kleinanzeigen-ads-renewer.jar
6+
7+
ENV JAVA_OPTIONS="-Xms128M -Xmx1024M"
8+
9+
CMD ["sh", "-c", "java $JAVA_OPTIONS -jar kleinanzeigen-ads-renewer.jar"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The host name for iCloud is: ``imap.mail.me.com``
3838
```yaml
3939
services:
4040
app:
41-
image: tutorialwork/kleinanzeigen-ads-renewer:1.2.0
41+
image: tutorialwork/kleinanzeigen-ads-renewer:latest
4242
environment:
4343
- IMAP_SERVERS_GMAIL_HOST=imap.gmail.com
4444
- IMAP_SERVERS_GMAIL_USERNAME=YOUR_GMAIL_EMAIL

pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@
8585
<groupId>org.springframework.boot</groupId>
8686
<artifactId>spring-boot-maven-plugin</artifactId>
8787
<configuration>
88-
<image>
89-
<name>tutorialwork/kleinanzeigen-ads-renewer:${project.version}</name>
90-
<buildpacks>
91-
<buildpack>paketobuildpacks/java</buildpack>
92-
</buildpacks>
93-
<env>
94-
<BP_JVM_VERSION>21</BP_JVM_VERSION>
95-
<BP_JVM_TYPE>JRE</BP_JVM_TYPE>
96-
</env>
97-
</image>
9888
<excludes>
9989
<exclude>
10090
<groupId>org.projectlombok</groupId>

0 commit comments

Comments
 (0)