Skip to content

Commit a06125b

Browse files
authored
Install WebP binaries in docker image (#269)
1 parent 6eeb794 commit a06125b

5 files changed

Lines changed: 1724 additions & 1660 deletions

File tree

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
FROM eclipse-temurin AS builder
2+
ARG LIBWEBP=libwebp-1.4.0-linux-x86-64
3+
RUN curl -s -L https://storage.googleapis.com/downloads.webmproject.org/releases/webp/${LIBWEBP}.tar.gz | \
4+
tar -xvzf - -C /tmp --one-top-level=libwebp --strip-components=1
25
WORKDIR /app
36
COPY settings.gradle build.gradle gradlew ./
47
COPY gradle ./gradle
@@ -10,6 +13,8 @@ RUN ./gradlew runtime --no-daemon
1013
FROM gcr.io/distroless/base-nossl:nonroot AS bot
1114
COPY --from=builder /app/build/jre ./jre
1215
COPY --from=builder /app/build/libs/Stickerify-shadow.jar .
16+
COPY --from=builder /tmp/libwebp/bin/cwebp /usr/local/bin/
17+
COPY --from=builder /tmp/libwebp/bin/dwebp /usr/local/bin/
1318
COPY --from=mwader/static-ffmpeg /ffmpeg /usr/local/bin/
1419
ENV FFMPEG_PATH=/usr/local/bin/ffmpeg
15-
CMD ["jre/bin/java", "-jar", "Stickerify-shadow.jar"]
20+
CMD ["jre/bin/java", "-Dcom.sksamuel.scrimage.webp.binary.dir=/usr/local/bin/", "-jar", "Stickerify-shadow.jar"]

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ application {
7878
}
7979

8080
runtime {
81-
options = ['--strip-debug', '--no-header-files', '--no-man-pages', '--compress=2']
81+
options = ['--strip-debug', '--no-header-files', '--no-man-pages']
8282
modules = ['java.desktop', 'java.naming', 'java.sql', 'jdk.crypto.ec']
8383
}
8484

@@ -87,4 +87,8 @@ shadowJar {
8787
archiveClassifier = 'shadow'
8888
archiveVersion = ''
8989
mergeServiceFiles()
90+
91+
dependencies {
92+
exclude('dist_webp_binaries/')
93+
}
9094
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ tika = "org.apache.tika:tika-core:2.9.2"
2525

2626
[plugins]
2727
runtime = "org.beryx.runtime:1.13.1"
28-
shadow = "com.github.johnrengelman.shadow:8.1.1"
28+
shadow = "com.gradleup.shadow:8.3.0"

0 commit comments

Comments
 (0)