Skip to content

Commit

Permalink
feat: remove ubuntu base image (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p authored Apr 7, 2024
1 parent f825418 commit b4efd36
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 214 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ insert_final_newline = true
[*.{bash,sh}]
indent_style = space
indent_size = 4

[Dockerfile]
indent_style = space
indent_size = 4
67 changes: 50 additions & 17 deletions apps/plex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,59 @@
FROM ghcr.io/onedr0p/ubuntu:jammy-20231004@sha256:6e060e90482632408063d0fbb4b616c77914ef10eaa6b089a00de5815471006c
ARG VERSION
FROM docker.io/library/golang:1.22 as envsubst
ARG VERSION
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
ARG TARGETPLATFORM
ENV CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
GOARM=${TARGETVARIANT}
RUN go install -ldflags="-s -w" github.com/drone/envsubst/cmd/envsubst@latest

FROM docker.io/library/ubuntu:22.04

ARG TARGETPLATFORM
ARG VERSION
ARG CHANNEL

ENV DEBCONF_NONINTERACTIVE_SEEN="true" \
DEBIAN_FRONTEND="noninteractive" \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE="DontWarn"

ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \
PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new" \
PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \
PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \
PLEX_MEDIA_SERVER_USER="kah" \
PLEX_MEDIA_SERVER_INFO_VENDOR="Docker" \
PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container (onedr0p)"

ENV UMASK="0002" \
TZ="Etc/UTC"

USER root

# hadolint ignore=DL3008,DL3015,SC2039,SC2086
RUN \
apt-get -qq update \
&& \
apt-get -qq install --no-install-recommends --no-install-suggests -y \
bash \
ca-certificates \
catatonit \
coreutils \
curl \
dnsutils \
iputils-ping \
jo \
jq \
moreutils \
tzdata \
unzip \
uuid-runtime \
vim-tiny \
xmlstarlet \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') \
export ARCH='amd64'; \
Expand All @@ -24,18 +63,11 @@ RUN \
;; \
esac \
&& \
apt-get -qq update \
&& \
apt-get -qq install -y \
ca-certificates \
libusb-dev \
uuid-runtime \
xmlstarlet \
&& \
curl -fsSL -o /tmp/plex.deb \
"${PLEX_DOWNLOAD}/${VERSION}/debian/plexmediaserver_${VERSION}_${ARCH}.deb" \
"https://downloads.plex.tv/plex-media-server-new/${VERSION}/debian/plexmediaserver_${VERSION}_${ARCH}.deb" \
&& \
dpkg -i --force-confold /tmp/plex.deb \
&& chmod -R 755 "${PLEX_MEDIA_SERVER_HOME}" \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt-get autoremove -y \
&& apt-get clean \
Expand All @@ -44,12 +76,13 @@ RUN \
/etc/default/plexmediaserver \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/ \
&& chown -R root:root /app \
&& chmod -R 755 "${PLEX_MEDIA_SERVER_HOME}" \
&& printf "umask %d\n" "${UMASK}" >> /etc/bash.bashrc
/var/tmp/

WORKDIR "${PLEX_MEDIA_SERVER_HOME}"
USER kah

COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

COPY ./apps/plex/entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/usr/bin/catatonit", "--" ]
CMD ["/entrypoint.sh"]
3 changes: 0 additions & 3 deletions apps/plex/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

#shellcheck disable=SC1091
test -f "/scripts/umask.sh" && source "/scripts/umask.sh"

#shellcheck disable=SC2155
export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m)
#shellcheck disable=SC2155
Expand Down
106 changes: 0 additions & 106 deletions apps/ubuntu/Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions apps/ubuntu/ci/goss.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions apps/ubuntu/ci/latest.sh

This file was deleted.

10 changes: 0 additions & 10 deletions apps/ubuntu/metadata.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions apps/ubuntu/scripts/greeting.sh

This file was deleted.

28 changes: 0 additions & 28 deletions apps/ubuntu/scripts/sleep.sh

This file was deleted.

3 changes: 0 additions & 3 deletions apps/ubuntu/scripts/umask.sh

This file was deleted.

10 changes: 0 additions & 10 deletions apps/ubuntu/scripts/vpn.sh

This file was deleted.

0 comments on commit b4efd36

Please sign in to comment.