Skip to content

Commit 9104bce

Browse files
committed
refactor: rename yml to yaml, standardize pkg templates, add Base category
1 parent 2caeaa5 commit 9104bce

7 files changed

Lines changed: 257 additions & 119 deletions

File tree

File renamed without changes.

Containerfile

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ ARG HEALTHCHECK_ENDPOINT="http://localhost:32400/identity"
88

99
ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"
1010

11+
# --- Metadata (Injected by Generator) ---
1112
LABEL org.opencontainers.image.title="Plex Media Server" \
12-
org.opencontainers.image.description="Plex Media Server on FreeBSD" \
13-
org.opencontainers.image.source="https://github.com/daemonless/plex" \
14-
org.opencontainers.image.url="https://plex.tv/" \
15-
org.opencontainers.image.documentation="https://support.plex.tv/" \
16-
org.opencontainers.image.licenses="Proprietary" \
17-
org.opencontainers.image.vendor="daemonless" \
18-
org.opencontainers.image.authors="daemonless" \
19-
io.daemonless.port="32400" \
20-
io.daemonless.arch="${FREEBSD_ARCH}" \
21-
io.daemonless.category="Media Servers" \
22-
io.daemonless.upstream-url="${UPSTREAM_URL}" \
23-
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
24-
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"
13+
org.opencontainers.image.description="Plex Media Server on FreeBSD." \
14+
org.opencontainers.image.source="https://github.com/daemonless/plex" \
15+
org.opencontainers.image.url="https://plex.tv/" \
16+
org.opencontainers.image.documentation="https://support.plex.tv/" \
17+
org.opencontainers.image.licenses="Proprietary" \
18+
org.opencontainers.image.vendor="daemonless" \
19+
org.opencontainers.image.authors="daemonless" \
20+
io.daemonless.category="Media Servers" \
21+
io.daemonless.port="32400" \
22+
io.daemonless.volumes="/config,/transcode,/movies,/tv" \
23+
io.daemonless.arch="${FREEBSD_ARCH}" \
24+
io.daemonless.upstream-url="${UPSTREAM_URL}" \
25+
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
26+
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"
2527

2628
# VERSION options:
2729
# container - use baked version, no updates (default)
@@ -32,8 +34,8 @@ LABEL org.opencontainers.image.title="Plex Media Server" \
3234
ENV VERSION="container"
3335

3436
# Create directories
35-
RUN mkdir -p /config /transcode /data /app /usr/local/share/plexmediaserver && \
36-
chown -R bsd:bsd /config /transcode /data /app /usr/local/share/plexmediaserver
37+
RUN mkdir -p /config /transcode /movies /tv /app /usr/local/share/plexmediaserver && \
38+
chown -R bsd:bsd /config /transcode /movies /tv /app /usr/local/share/plexmediaserver
3739

3840
# Download Plex at build time (public channel)
3941
RUN PLEX_URL="https://plex.tv/downloads/latest/1?channel=16&build=freebsd-x86_64&distro=freebsd" && \
@@ -50,8 +52,8 @@ COPY root/ /
5052
# Make scripts executable
5153
RUN chmod +x /etc/services.d/plex/run /etc/services.d/plex/finish /etc/cont-init.d/* 2>/dev/null || true
5254

53-
# Plex ports (matching official pms-docker)
54-
EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
55+
# --- Expose (Injected by Generator) ---
56+
EXPOSE 32400 1900 32410 32412 32413 32414 32469 8324
5557

56-
# Volumes matching official pms-docker
57-
VOLUME /config /transcode /data
58+
# --- Volumes (Injected by Generator) ---
59+
VOLUME /config /transcode /movies /tv

Containerfile.j2

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
ARG BASE_VERSION=15
2+
FROM ghcr.io/daemonless/base:${BASE_VERSION}
3+
4+
ARG FREEBSD_ARCH=amd64
5+
ARG UPSTREAM_URL="https://plex.tv/api/downloads/5.json"
6+
ARG UPSTREAM_JQ=".computer.FreeBSD.version"
7+
{%- if ports %}
8+
ARG HEALTHCHECK_ENDPOINT="http://localhost:{{ ports[0].port }}/identity"
9+
{%- else %}
10+
ARG HEALTHCHECK_ENDPOINT="http://localhost:32400/identity"
11+
{%- endif %}
12+
13+
ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"
14+
15+
# --- Metadata (Injected by Generator) ---
16+
LABEL org.opencontainers.image.title="{{ title }}" \
17+
org.opencontainers.image.description="{{ description }}" \
18+
org.opencontainers.image.source="{{ repo_url }}" \
19+
org.opencontainers.image.url="{{ web_url }}" \
20+
org.opencontainers.image.documentation="https://support.plex.tv/" \
21+
org.opencontainers.image.licenses="Proprietary" \
22+
org.opencontainers.image.vendor="daemonless" \
23+
org.opencontainers.image.authors="daemonless" \
24+
io.daemonless.category="{{ category }}" \
25+
{%- if ports %}
26+
io.daemonless.port="{{ ports[0].port }}" \
27+
{%- endif %}
28+
{%- if volumes %}
29+
io.daemonless.volumes="{{ volumes | map(attribute='path') | join(',') }}" \
30+
{%- endif %}
31+
{%- if mlock %}
32+
org.freebsd.jail.allow.mlock="required" \
33+
{%- endif %}
34+
io.daemonless.arch="${FREEBSD_ARCH}" \
35+
io.daemonless.upstream-url="${UPSTREAM_URL}" \
36+
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
37+
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"
38+
39+
# VERSION options:
40+
# container - use baked version, no updates (default)
41+
# public - update to latest public channel
42+
# latest - alias for plexpass
43+
# plexpass - update to plexpass channel (requires PlexOnlineToken)
44+
# x.y.z - update to specific version
45+
ENV VERSION="container"
46+
47+
# Create directories
48+
RUN mkdir -p /config /transcode /movies /tv /app /usr/local/share/plexmediaserver && \
49+
chown -R bsd:bsd /config /transcode /movies /tv /app /usr/local/share/plexmediaserver
50+
51+
# Download Plex at build time (public channel)
52+
RUN PLEX_URL="https://plex.tv/downloads/latest/1?channel=16&build=freebsd-x86_64&distro=freebsd" && \
53+
echo "Downloading Plex from: ${PLEX_URL}" && \
54+
fetch -qo /tmp/plex.tar.bz2 "${PLEX_URL}" && \
55+
tar -xf /tmp/plex.tar.bz2 -C /usr/local/share/plexmediaserver --strip-components=1 && \
56+
rm /tmp/plex.tar.bz2 && \
57+
"/usr/local/share/plexmediaserver/Plex Media Server" --version | tr -d 'v' > /app/version && \
58+
chown -R bsd:bsd /usr/local/share/plexmediaserver /app
59+
60+
# Copy service definition and init scripts
61+
COPY root/ /
62+
63+
# Make scripts executable
64+
RUN chmod +x /etc/services.d/plex/run /etc/services.d/plex/finish /etc/cont-init.d/* 2>/dev/null || true
65+
66+
# --- Expose (Injected by Generator) ---
67+
{%- if ports %}
68+
EXPOSE {{ ports | map(attribute='port') | join(' ') }}
69+
{%- endif %}
70+
71+
# --- Volumes (Injected by Generator) ---
72+
{%- if volumes %}
73+
VOLUME {{ volumes | map(attribute='path') | join(' ') }}
74+
{%- endif %}

README.md

Lines changed: 102 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,17 @@
11
# Plex Media Server
22

3-
[Plex](https://plex.tv) organizes video, music and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices.
3+
Plex Media Server on FreeBSD.
44

5-
## Supported Architectures
5+
| | |
6+
|---|---|
7+
| **Port** | 32400 |
8+
| **Registry** | `ghcr.io/daemonless/plex` |
9+
| **Source** | [https://github.com/daemonless/plex](https://github.com/daemonless/plex) |
10+
| **Website** | [https://plex.tv/](https://plex.tv/) |
611

7-
| Architecture | Available | Tag |
8-
|--------------|-----------|-----|
9-
| x86-64 || `amd64` |
12+
## Deployment
1013

11-
## Version Tags
12-
13-
| Tag | Description |
14-
|-----|-------------|
15-
| `latest` | Latest public Plex release baked at build time |
16-
| `x.y.z.build-hash` | Specific version (e.g., `1.42.2.10156-f737b826c`) |
17-
18-
## Application Setup
19-
20-
Access the web UI at `http://<your-ip>:32400/web` to configure Plex.
21-
22-
### VERSION Environment Variable
23-
24-
The `VERSION` parameter controls Plex update behavior:
25-
26-
| Value | Description |
27-
|-------|-------------|
28-
| `container` | Use the version baked into the container, no updates (default) |
29-
| `public` | Update to latest public channel release |
30-
| `latest` | Alias for `plexpass` |
31-
| `plexpass` | Update to PlexPass channel (requires PlexOnlineToken in Preferences.xml) |
32-
| `<specific-version>` | Update to a specific version (e.g., `1.42.2.10156-f737b826c`) |
33-
34-
**Note:** PlexPass versions require authentication. Log in via the web UI first, then restart the container with `VERSION=plexpass`.
35-
36-
### Claiming Your Server
37-
38-
To claim a new server, get a claim token from [plex.tv/claim](https://plex.tv/claim) (valid for 4 minutes) and pass it via `PLEX_CLAIM` environment variable on first run.
39-
40-
## Usage
41-
42-
### podman run
43-
44-
```bash
45-
podman run -d \
46-
--name plex \
47-
-p 32400:32400 \
48-
-e PUID=1000 \
49-
-e PGID=1000 \
50-
-e TZ=America/New_York \
51-
-v /path/to/config:/config \
52-
-v /path/to/media:/data \
53-
-v /path/to/transcode:/transcode \
54-
ghcr.io/daemonless/plex:latest
55-
```
56-
57-
### podman-compose
14+
### Podman Compose
5815

5916
```yaml
6017
services:
@@ -64,72 +21,117 @@ services:
6421
environment:
6522
- PUID=1000
6623
- PGID=1000
67-
- TZ=America/New_York
68-
# - VERSION=public
69-
# - PLEX_CLAIM=claim-xxxx
70-
# - ADVERTISE_IP=http://<your-ip>:32400/
24+
- TZ=UTC
25+
- VERSION=container
26+
- PLEX_CLAIM=
7127
volumes:
72-
- /data/config/plex:/config
73-
- /data/media:/data
74-
- /tmp/plex-transcode:/transcode
28+
- /path/to/containers/plex:/config
29+
- /path/to/containers/plex/transcode:/transcode # optional
30+
- /path/to/movies:/movies
31+
- /path/to/tv:/tv
7532
ports:
7633
- 32400:32400
77-
- 8324:8324
34+
- 1900:1900
35+
- 32410:32410
36+
- 32412:32412
37+
- 32413:32413
38+
- 32414:32414
7839
- 32469:32469
79-
- 1900:1900/udp
80-
- 32410:32410/udp
81-
- 32412:32412/udp
82-
- 32413:32413/udp
83-
- 32414:32414/udp
40+
- 8324:8324
8441
restart: unless-stopped
8542
```
8643
87-
## Parameters
44+
### Podman CLI
8845
89-
### Ports
46+
```bash
47+
podman run -d --name plex \
48+
-p 32400:32400 \
49+
-p 1900:1900 \
50+
-p 32410:32410 \
51+
-p 32412:32412 \
52+
-p 32413:32413 \
53+
-p 32414:32414 \
54+
-p 32469:32469 \
55+
-p 8324:8324 \
56+
-e PUID=@PUID@ \
57+
-e PGID=@PGID@ \
58+
-e TZ=@TZ@ \
59+
-e VERSION=container \
60+
-e PLEX_CLAIM= \
61+
-v /path/to/containers/plex:/config \
62+
-v /path/to/containers/plex/transcode:/transcode \ # optional
63+
-v /path/to/movies:/movies \
64+
-v /path/to/tv:/tv \
65+
ghcr.io/daemonless/plex:latest
66+
```
67+
Access at: `http://localhost:32400`
9068

91-
| Port | Description |
92-
|------|-------------|
93-
| `32400` | Web UI and API |
94-
| `8324` | Companion app |
95-
| `32469` | DLNA |
96-
| `1900/udp` | SSDP discovery |
97-
| `32410-32414/udp` | GDM discovery |
69+
### Ansible
70+
71+
```yaml
72+
- name: Deploy plex
73+
containers.podman.podman_container:
74+
name: plex
75+
image: ghcr.io/daemonless/plex:latest
76+
state: started
77+
restart_policy: always
78+
env:
79+
PUID: "1000"
80+
PGID: "1000"
81+
TZ: "UTC"
82+
VERSION: "container"
83+
PLEX_CLAIM: ""
84+
ports:
85+
- "32400:32400"
86+
- "1900:1900"
87+
- "32410:32410"
88+
- "32412:32412"
89+
- "32413:32413"
90+
- "32414:32414"
91+
- "32469:32469"
92+
- "8324:8324"
93+
volumes:
94+
- "/path/to/containers/plex:/config"
95+
- "/path/to/containers/plex/transcode:/transcode" # optional
96+
- "/path/to/movies:/movies"
97+
- "/path/to/tv:/tv"
98+
```
99+
100+
## Configuration
98101
99102
### Environment Variables
100103
101104
| Variable | Default | Description |
102105
|----------|---------|-------------|
103-
| `PUID` | `1000` | User ID |
104-
| `PGID` | `1000` | Group ID |
105-
| `TZ` | `UTC` | Timezone |
106-
| `VERSION` | `container` | Update behavior (see above) |
107-
| `PLEX_CLAIM` | | Claim token from plex.tv/claim |
108-
| `ADVERTISE_IP` | | Override advertised IP |
106+
| `PUID` | `1000` | User ID for the application process |
107+
| `PGID` | `1000` | Group ID for the application process |
108+
| `TZ` | `UTC` | Timezone for the container |
109+
| `VERSION` | `container` | Plex update channel (container, public, plexpass) |
110+
| `PLEX_CLAIM` | `` | Optional: Claim token from https://plex.tv/claim |
109111

110112
### Volumes
111113

112114
| Path | Description |
113115
|------|-------------|
114-
| `/config` | Configuration and database |
115-
| `/data` | Media library |
116-
| `/transcode` | Temporary transcoding directory |
117-
118-
## User/Group Identifiers
119-
120-
Set `PUID` and `PGID` to match your host user to avoid permission issues:
121-
122-
```bash
123-
id your_user
124-
```
125-
126-
## Support Info
116+
| `/config` | Configuration directory |
117+
| `/transcode` | Transcode directory (Optional) |
118+
| `/movies` | Movie library |
119+
| `/tv` | TV series library |
127120

128-
- Shell access: `podman exec -it plex /bin/sh`
129-
- Logs: `podman logs plex`
130-
- Container version: `podman inspect plex | grep org.opencontainers.image.version`
131-
132-
## Links
121+
### Ports
133122

134-
- [Plex Website](https://plex.tv/)
135-
- [Plex Support](https://support.plex.tv/)
123+
| Port | Protocol | Description |
124+
|------|----------|-------------|
125+
| `32400` | TCP | Web UI |
126+
| `1900` | TCP | |
127+
| `32410` | TCP | |
128+
| `32412` | TCP | |
129+
| `32413` | TCP | |
130+
| `32414` | TCP | |
131+
| `32469` | TCP | |
132+
| `8324` | TCP | |
133+
134+
## Notes
135+
136+
- **User:** `bsd` (UID/GID set via PUID/PGID)
137+
- **Base:** Built on `ghcr.io/daemonless/base` (FreeBSD)

0 commit comments

Comments
 (0)