Update Dockerfile
Browse files- Dockerfile +36 -44
Dockerfile
CHANGED
|
@@ -1,62 +1,54 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
|
| 4 |
|
| 5 |
-
# Set version
|
| 6 |
ARG BUILD_DATE
|
| 7 |
ARG VERSION
|
| 8 |
ARG JACKETT_RELEASE
|
| 9 |
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
| 10 |
LABEL maintainer="thelamer"
|
| 11 |
|
| 12 |
-
#
|
| 13 |
ENV XDG_DATA_HOME="/config" \
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
PATH=/root/.local/bin:$PATH
|
| 20 |
|
| 21 |
-
# Set the working directory
|
| 22 |
-
WORKDIR /
|
| 23 |
|
| 24 |
-
# Install packages
|
| 25 |
RUN \
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
/
|
| 39 |
-
"
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
| 48 |
-
echo "**** cleanup ****" && \
|
| 49 |
-
rm -rf /tmp/*
|
| 50 |
-
|
| 51 |
-
# Create the /root directory within the container (if not present)
|
| 52 |
RUN mkdir -p /root
|
| 53 |
|
| 54 |
-
#
|
| 55 |
VOLUME /config
|
| 56 |
-
|
| 57 |
EXPOSE 9117
|
| 58 |
|
| 59 |
-
#
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
# Set the entrypoint or command (if applicable)
|
|
|
|
| 1 |
+
# Use the Alpine Linux base image from the Linuxserver.io repository
|
|
|
|
| 2 |
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
|
| 3 |
|
| 4 |
+
# Set version labels for the build
|
| 5 |
ARG BUILD_DATE
|
| 6 |
ARG VERSION
|
| 7 |
ARG JACKETT_RELEASE
|
| 8 |
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
| 9 |
LABEL maintainer="thelamer"
|
| 10 |
|
| 11 |
+
# Define environment variables for Jackett's configuration
|
| 12 |
ENV XDG_DATA_HOME="/config" \
|
| 13 |
+
XDG_CONFIG_HOME="/config" \
|
| 14 |
+
TMPDIR="/run/jackett-temp" \
|
| 15 |
+
HOME="/home/user" \
|
| 16 |
+
PATH="/home/user/.local/bin:$PATH"
|
| 17 |
|
| 18 |
+
# Create a user with UID 1000 to avoid permission issues
|
| 19 |
+
RUN useradd -m -u 1000 user
|
|
|
|
| 20 |
|
| 21 |
+
# Set the working directory to the user's home directory
|
| 22 |
+
WORKDIR $HOME/app
|
| 23 |
|
| 24 |
+
# Install necessary packages and Jackett
|
| 25 |
RUN \
|
| 26 |
+
echo "**** install packages ****" && \
|
| 27 |
+
apk --no-cache add icu-data-full icu-libs && \
|
| 28 |
+
echo "**** install jackett ****" && \
|
| 29 |
+
mkdir -p /app/Jackett && \
|
| 30 |
+
if [ -z ${JACKETT_RELEASE+x} ]; then \
|
| 31 |
+
JACKETT_RELEASE=$(curl -sX GET "https://api.github.com/repos/Jackett/Jackett/releases/latest" | jq -r .tag_name); \
|
| 32 |
+
fi && \
|
| 33 |
+
curl -o /tmp/jacket.tar.gz -L "https://github.com/Jackett/Jackett/releases/download/${JACKETT_RELEASE}/Jackett.Binaries.LinuxMuslAMDx64.tar.gz" && \
|
| 34 |
+
tar xf /tmp/jacket.tar.gz -C /app/Jackett --strip-components=1 && \
|
| 35 |
+
echo "**** fix for host id mapping error ****" && \
|
| 36 |
+
chown -R root:root /app/Jackett && \
|
| 37 |
+
echo "**** save docker image version ****" && \
|
| 38 |
+
echo "${VERSION}" > /etc/docker-image && \
|
| 39 |
+
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
| 40 |
+
echo "**** cleanup ****" && \
|
| 41 |
+
rm -rf /tmp/*
|
| 42 |
+
|
| 43 |
+
# Ensure everything runs as root
|
| 44 |
+
USER root
|
| 45 |
+
|
| 46 |
+
# Create the /root directory within the container (for use by the application, if needed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
RUN mkdir -p /root
|
| 48 |
|
| 49 |
+
# Define volumes and ports for the application
|
| 50 |
VOLUME /config
|
|
|
|
| 51 |
EXPOSE 9117
|
| 52 |
|
| 53 |
+
# Default command to run when the container starts (optional, can be defined here)
|
| 54 |
+
# CMD ["path/to/your/jackett"]
|
|
|
|
|
|