Mythus commited on
Commit
3a7d124
·
verified ·
1 Parent(s): d214841

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -44
Dockerfile CHANGED
@@ -1,62 +1,54 @@
1
- # syntax=docker/dockerfile:1
2
-
3
  FROM ghcr.io/linuxserver/baseimage-alpine:3.20
4
 
5
- # Set version label
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
- # Environment settings
13
  ENV XDG_DATA_HOME="/config" \
14
- XDG_CONFIG_HOME="/config" \
15
- TMPDIR=/run/jackett-temp
 
 
16
 
17
- # Set home to root and working directory
18
- ENV HOME=/root \
19
- PATH=/root/.local/bin:$PATH
20
 
21
- # Set the working directory
22
- WORKDIR /root/app
23
 
24
- # Install packages as root
25
  RUN \
26
- echo "**** install packages ****" && \
27
- apk --no-cache add \
28
- icu-data-full \
29
- icu-libs && \
30
- echo "**** install jackett ****" && \
31
- mkdir -p \
32
- /app/Jackett && \
33
- if [ -z ${JACKETT_RELEASE+x} ]; then \
34
- JACKETT_RELEASE=$(curl -sX GET "https://api.github.com/repos/Jackett/Jackett/releases/latest" \
35
- | jq -r .tag_name); \
36
- fi && \
37
- curl -o \
38
- /tmp/jacket.tar.gz -L \
39
- "https://github.com/Jackett/Jackett/releases/download/${JACKETT_RELEASE}/Jackett.Binaries.LinuxMuslAMDx64.tar.gz" && \
40
- tar xf \
41
- /tmp/jacket.tar.gz -C \
42
- /app/Jackett --strip-components=1 && \
43
- echo "**** fix for host id mapping error ****" && \
44
- chown -R root:root /app/Jackett && \
45
- echo "**** save docker image version ****" && \
46
- echo "${VERSION}" > /etc/docker-image && \
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
- # Ports and volumes
55
  VOLUME /config
56
-
57
  EXPOSE 9117
58
 
59
- # Copy local files to the image
60
- COPY root/ /
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"]