-
-
Notifications
You must be signed in to change notification settings - Fork 322
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
38 lines (30 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# syntax=docker/dockerfile:1
## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-alpine:3.23 AS buildstage
ARG MOD_VERSION
RUN curl -L https://archive.org/download/kindlegen_linux_2_6_i386_v2_9/kindlegen_linux_2.6_i386_v2_9.tar.gz > kindlegen.tar.gz
RUN tar -zxvf kindlegen.tar.gz kindlegen
RUN chmod +rwx 'kindlegen'
RUN rm kindlegen.tar.gz
RUN \
if [ -z ${MOD_VERSION} ]; then \
echo "MOD_VERSION is not set. Fetching from GitHub..."; \
MOD_VERSION=$(curl -s "https://api.github.com/repos/ciromattia/kcc/releases/latest" | jq -rc ".tag_name"); \
else \
echo "MOD_VERSION is already set to '${MOD_VERSION}'"; \
fi && \
echo "Using MOD_VERSION=${MOD_VERSION}" && \
curl -L https://github.com/ciromattia/kcc/archive/refs/tags/${MOD_VERSION}.tar.gz > kcc.tar.gz && \
tar -xzf kcc.tar.gz && \
mv kcc-$(echo "${MOD_VERSION}" | sed 's/^.\(.*\)/\1/') kcc && \
touch kcc/KCC_VERSION && \
echo ${MOD_VERSION} > kcc/KCC_VERSION && \
mkdir -p /root-layer/usr/local/bin && \
mv kindlegen /root-layer/usr/local/bin/ && \
mv kcc /root-layer/usr/local/bin/
COPY root/ /root-layer/
## Single layer deployed image ##
FROM scratch
LABEL maintainer="hvmzx"
# Add files from buildstage
COPY --from=buildstage /root-layer/ /