multi stage the build and add lib path so emby libs do not always take precedence to sys libs

This commit is contained in:
thelamer
2019-05-31 10:28:47 -07:00
parent 2d920e0cb1
commit 42a6da0f93
4 changed files with 66 additions and 61 deletions

View File

@@ -1,14 +1,7 @@
FROM lsiobase/ubuntu:bionic FROM lsiobase/ubuntu:bionic as buildstage
# set version label # build args
ARG BUILD_DATE
ARG VERSION
ARG EMBY_RELEASE ARG EMBY_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"
RUN \ RUN \
@@ -36,21 +29,29 @@ RUN \
/tmp/opt/emby-server/system/* \ /tmp/opt/emby-server/system/* \
/tmp/opt/emby-server/lib/samba/* \ /tmp/opt/emby-server/lib/samba/* \
/tmp/opt/emby-server/lib/* \ /tmp/opt/emby-server/lib/* \
/tmp/opt/emby-server/bin/ff* && \ /tmp/opt/emby-server/bin/ff*
echo "**** cleanup ****" && \
apt-get purge -y \ # runtime stage
cpio \ FROM lsiobase/ubuntu:bionic
jq \
rpm2cpio && \ # set version label
apt-get autoremove -fy && \ ARG BUILD_DATE
rm -rf \ ARG VERSION
/tmp/* \ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
/var/lib/apt/lists/* \ LABEL maintainer="thelamer"
/var/tmp/*
# add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
# add local files # add local files
COPY --from=buildstage /app/emby /app/emby
COPY root/ / COPY root/ /
# lib setup
RUN \
echo "/app/emby" > /etc/ld.so.conf.d/emby.conf && \
ldconfig
# ports and volumes # ports and volumes
EXPOSE 8096 8920 EXPOSE 8096 8920
VOLUME /config /transcode VOLUME /config /transcode

View File

@@ -1,14 +1,7 @@
FROM lsiobase/ubuntu:arm64v8-bionic FROM lsiobase/ubuntu:arm64v8-bionic as buildstage
# set version label # build args
ARG BUILD_DATE
ARG VERSION
ARG EMBY_RELEASE ARG EMBY_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"
RUN \ RUN \
@@ -36,21 +29,30 @@ RUN \
/tmp/opt/emby-server/system/* \ /tmp/opt/emby-server/system/* \
/tmp/opt/emby-server/lib/samba/* \ /tmp/opt/emby-server/lib/samba/* \
/tmp/opt/emby-server/lib/* \ /tmp/opt/emby-server/lib/* \
/tmp/opt/emby-server/bin/ff* && \ /tmp/opt/emby-server/bin/ff*
echo "**** cleanup ****" && \
apt-get purge -y \ # runtime stage
cpio \ FROM lsiobase/ubuntu:arm64v8-bionic
jq \
rpm2cpio && \ # set version label
apt-get autoremove -fy && \ ARG BUILD_DATE
rm -rf \ ARG VERSION
/tmp/* \ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
/var/lib/apt/lists/* \ LABEL maintainer="thelamer"
/var/tmp/*
# add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
# add local files # add local files
COPY --from=buildstage /app/emby /app/emby
COPY root/ / COPY root/ /
# lib setup
RUN \
echo "**** add lib path ****" && \
echo "/app/emby" > /etc/ld.so.conf.d/emby.conf && \
ldconfig
# ports and volumes # ports and volumes
EXPOSE 8096 8920 EXPOSE 8096 8920
VOLUME /config /transcode VOLUME /config /transcode

View File

@@ -1,14 +1,7 @@
FROM lsiobase/ubuntu:arm32v7-bionic FROM lsiobase/ubuntu:arm32v7-bionic as buildstage
# set version label # build args
ARG BUILD_DATE
ARG VERSION
ARG EMBY_RELEASE ARG EMBY_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"
RUN \ RUN \
@@ -36,21 +29,30 @@ RUN \
/tmp/opt/emby-server/system/* \ /tmp/opt/emby-server/system/* \
/tmp/opt/emby-server/lib/samba/* \ /tmp/opt/emby-server/lib/samba/* \
/tmp/opt/emby-server/lib/* \ /tmp/opt/emby-server/lib/* \
/tmp/opt/emby-server/bin/ff* && \ /tmp/opt/emby-server/bin/ff*
echo "**** cleanup ****" && \
apt-get purge -y \ # runtime stage
cpio \ FROM lsiobase/ubuntu:arm32v7-bionic
jq \
rpm2cpio && \ # set version label
apt-get autoremove -fy && \ ARG BUILD_DATE
rm -rf \ ARG VERSION
/tmp/* \ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
/var/lib/apt/lists/* \ LABEL maintainer="thelamer"
/var/tmp/*
# add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
# add local files # add local files
COPY --from=buildstage /app/emby /app/emby
COPY root/ / COPY root/ /
# lib setup
RUN \
echo "**** add lib path ****" && \
echo "/app/emby" > /etc/ld.so.conf.d/emby.conf && \
ldconfig
# ports and volumes # ports and volumes
EXPOSE 8096 8920 EXPOSE 8096 8920
VOLUME /config /transcode VOLUME /config /transcode

View File

@@ -1,6 +1,6 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
LD_LIBRARY_PATH=/app/emby exec \ exec \
s6-setuidgid abc /app/emby/EmbyServer \ s6-setuidgid abc /app/emby/EmbyServer \
-programdata /config \ -programdata /config \
-ffdetect /app/emby/ffdetect \ -ffdetect /app/emby/ffdetect \