Mythus commited on
Commit
9d832d6
·
verified ·
1 Parent(s): c4cf733

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -42
Dockerfile CHANGED
@@ -1,51 +1,44 @@
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
 
 
 
 
1
+ # Use an official Ubuntu image as a base
2
+ FROM ubuntu:22.04
3
+
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive \
6
+ HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
+
9
+ # Create a new user named "user" with user ID 1000 to avoid permission issues
 
 
 
 
 
 
 
 
 
10
  RUN useradd -m -u 1000 user
11
 
12
  # Set the working directory to the user's home directory
13
  WORKDIR $HOME/app
14
 
15
+ # Update and install dependencies
16
+ RUN apt-get update && \
17
+ apt-get install -y wget curl libicu-dev libcurl4-openssl-dev tar && \
18
+ rm -rf /var/lib/apt/lists/*
19
+
20
+ # Switch to the "user" user for all operations moving forward
21
+ USER user
22
+
23
+ # Create directories for Jackett installation and downloads
24
+ RUN mkdir -p /opt/Jackett
25
+
26
+ # Download and extract the latest Jackett release into /opt/Jackett
27
+ RUN release=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) && \
28
+ f=Jackett.Binaries.LinuxAMDx64.tar.gz && \
29
+ wget -Nc https://github.com/Jackett/Jackett/releases/download/$release/"$f" -P /opt && \
30
+ tar -xzf /opt/"$f" -C /opt/Jackett && \
31
+ rm /opt/"$f"
32
+
33
+ # Switch back to root to set up Jackett as a service
 
34
  USER root
35
 
36
+ # Install Jackett as a systemd service
37
+ WORKDIR /opt/Jackett/Jackett*
38
+ RUN ./install_service_systemd.sh
39
 
40
+ # Expose the port used by Jackett (default is 9117)
 
41
  EXPOSE 9117
42
+
43
+ # Set the default command to check the status of Jackett service
44
+ CMD ["systemctl", "status", "jackett.service"]