diff --git a/builders/emby-server/debian/jessie/Dockerfile b/builders/emby-server/debian/jessie/Dockerfile index 5b5ded4..e9812be 100644 --- a/builders/emby-server/debian/jessie/Dockerfile +++ b/builders/emby-server/debian/jessie/Dockerfile @@ -4,8 +4,8 @@ MAINTAINER HurricaneHrndz ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ && apt-get install -y wget \ - && wget -qO - http://download.opensuse.org/repositories/home:hurricanehernandez:emby-server/Debian_8.0/Release.key | apt-key add - \ - && echo 'deb http://download.opensuse.org/repositories/home:/hurricanehernandez:/emby-server/Debian_8.0/ /' >> /etc/apt/sources.list.d/emby-server.list \ + && wget -qO - http://download.opensuse.org/repositories/home:/emby/Debian_8.0/Release.key | apt-key add - \ + && echo 'deb http://download.opensuse.org/repositories/home:/emby/Debian_8.0/ /' >> /etc/apt/sources.list.d/emby-server.list \ && apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ diff --git a/builders/emby-server/ubuntu/xenial/Dockerfile b/builders/emby-server/ubuntu/xenial/Dockerfile index 9e7b8d7..3a98258 100644 --- a/builders/emby-server/ubuntu/xenial/Dockerfile +++ b/builders/emby-server/ubuntu/xenial/Dockerfile @@ -4,8 +4,8 @@ MAINTAINER HurricaneHrndz ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ && apt-get install -y wget \ - && wget -qO - http://download.opensuse.org/repositories/home:hurricanehernandez:emby-server/xUbuntu_16.04/Release.key | apt-key add - \ - && echo 'deb http://download.opensuse.org/repositories/home:/hurricanehernandez:/emby-server/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/emby-server.list \ + && wget -qO - http://download.opensuse.org/repositories/home:emby:emby-server/xUbuntu_16.04/Release.key | apt-key add - \ + && echo 'deb http://download.opensuse.org/repositories/home:/emby:/emby-server/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/emby-server.list \ && apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ diff --git a/docker-containers/arm/Dockerfile b/docker-containers/arm/Dockerfile deleted file mode 100644 index 0c366e1..0000000 --- a/docker-containers/arm/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Emby Server -FROM scratch -MAINTAINER Carlos Hernandez -ENV APP_NAME="emby-server" IMG_NAME="embyserver" TAG_NAME="latest" PKG_NAME="emby-server" LANG="en_US.UTF-8" EDGE=0 UMASK=002 - -ADD rootfs.tar.xz / - -VOLUME [ "/config" ] -EXPOSE 8096 8920 7359/udp 1900/udp - -ENTRYPOINT ["/init"] diff --git a/docker-containers/arm/Makefile b/docker-containers/arm/Makefile deleted file mode 100644 index 919517b..0000000 --- a/docker-containers/arm/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/make -f - -all: armv7 aarch64 -.PHONY: all armv7 aarch64 end - -armv7: ARCH := "armv7" -aarch64: ARCH := "aarch64" -armv7 aarch64: - @echo "Building $(ARCH)" - $(eval img_name := $(shell curl -s http://download.opensuse.org/repositories/home:/emby:/docker/images/ --list-only | grep "emby" | sed -n s%".*>\(.*${ARCH}.*-.*tar.xz\).*"%"\1"%p | sort -i | head -1)) - curl -sSL http://download.opensuse.org/repositories/home:/emby:/docker/images/$(img_name) -o rootfs.tar.xz - sed -i s/"\(TAG_NAME=\)\([^ ]*\)"/"\1$(ARCH)"/ Dockerfile - docker build --rm=true --tag=emby/embyserver:$(ARCH) . - docker push emby/embyserver:$(ARCH) - docker rmi emby/embyserver:$(ARCH) - rm rootfs.tar.xz - git reset --hard - -end: - @echo "Done!" diff --git a/docker-containers/base/Dockerfile b/docker-containers/base/Dockerfile index 9cd4a77..a4684ad 100644 --- a/docker-containers/base/Dockerfile +++ b/docker-containers/base/Dockerfile @@ -1,67 +1,9 @@ -FROM opensuse/amd64:tumbleweed +FROM scratch MAINTAINER Carlos Hernandez +ARG ARCH=x86_64 +ENV LC_ALL="C.utf8" -ENV LANG="en_US.UTF-8" s6_overlay_version="1.19.1.1" - -RUN zypper --non-interactive ar -f -n repo-emby http://download.opensuse.org/repositories/home:emby/openSUSE_Tumbleweed repo-emby \ - && zypper --gpg-auto-import-keys ref \ - && zypper --non-interactive update --no-recommends \ - && zypper --non-interactive in --no-recommends \ - at \ - ca-certificates{,-cacert,-mozilla} \ - curl \ - dejavu-fonts \ - embymagick \ - glibc-locale \ - libembysqlite3-0 \ - libHX28 \ - mono-core \ - mono-data \ - mono-data-sqlite \ - mono-extras \ - mono-mvc \ - mono-wcf \ - mono-wcf \ - mono-web \ - mono-winfxcore \ - sudo \ - tar \ - timezone \ - xz \ - && curl -L https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-amd64.tar.gz -o /tmp/s6-overlay-amd64.tar.gz \ - && tar zvxf /tmp/s6-overlay-amd64.tar.gz -C / \ - && curl -L https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz -o /tmp/ffmpeg.tar.xz \ - && tar -C /bin --extract --file=/tmp/ffmpeg.tar.xz --wildcards "*/ffmpeg" --strip-components=1 \ - && tar -C /bin --extract --file=/tmp/ffmpeg.tar.xz --wildcards "*/ffprobe" --strip-components=1 \ - && rpm -e --nodeps --allmatches --noscripts \ - `rpm -qa | grep aaa_base` \ - `rpm -qa | grep acl | grep -v lib` \ - `rpm -qa | grep branding-openSUSE` \ - `rpm -qa | grep cpio` \ - `rpm -qa | grep cryptsetup` \ - `rpm -qa | grep dracut` \ - `rpm -qa | grep fipscheck` \ - `rpm -qa | grep kbd` \ - `rpm -qa | grep kmod` \ - `rpm -qa | grep mapper` \ - `rpm -qa | grep ncurses-utils` \ - `rpm -qa | grep openSUSE-release` \ - `rpm -qa | grep perl` \ - `rpm -qa | grep pigz` \ - `rpm -qa | grep pinentry` \ - `rpm -qa | grep pkg-config` \ - `rpm -qa | grep qrencode` \ - `rpm -qa | grep sg3_utils` \ - cpio \ - curl \ - && zypper --non-interactive al dbus-1 kbd kmod systemd systemd-presets-branding-openSUSE udev openSUSE-release-ftp \ - && zypper cc --all \ - && rm -rf /var/cache/zypp* \ - && rm -rf /tmp/* \ - && rm -rf /var/log/* \ - && cd /usr/lib/locale \ - && ls | grep -ve "en_US*" | xargs rm -rf \ - && cd /usr/share/locale \ - && find -name '*.mo' | grep -ve "en_US*" | xargs rm -rf - -COPY root / +ADD rootfs.tar.xz / +ADD overlay-common / +ADD overlay-${ARCH} / +COPY usr /usr/ diff --git a/docker-containers/base/Makefile b/docker-containers/base/Makefile index 3a41775..8e35734 100644 --- a/docker-containers/base/Makefile +++ b/docker-containers/base/Makefile @@ -1,25 +1,53 @@ -all: build +#!/usr/bin/make -f -IMG_NAME="emby-base" +SHELL := /bin/bash +IMG_NAME := "emby-base" +IMG_REPO := "emby" -ifndef APP_REPO -APP_REPO=${USER} -endif +root_repo := "http://download.opensuse.org/repositories/home:/emby:/docker/images/" +qemu_repo := "http://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64" -help: - @echo "" - @echo "-- Help Menu" - @echo "" - @echo " 1. make base - build the emby-sever base image" - @echo "" +all: armv7l aarch64 x86_64 +.PHONY: all armv7l aarch64 x86_64 end -clean: - @docker rm -f `docker ps -a | grep "${APP_REPO}/${IMG_NAME}" | awk '{print $$1}'` > /dev/null 2>&1 || exit 0 - @docker rmi `docker images | grep "${APP_REPO}/${IMG_NAME}" | awk '{print $$3}'` > /dev/null 2>&1 || exit 0 +armv7l: ARCH := "armv7l" +aarch64: ARCH := "aarch64" +x86_64: ARCH := "x86_64" +armv7l aarch64 x86_64: + @ echo "Building emby base image for $(ARCH)" + BUILDDIR = /var/tmp/$(IMG_REPO)_$(IMG_NAME)_$(ARCH) + @ if [[ -d $(BUILDDIR) ]]; then \ + rm -rf $(BUILDDIR); \ + fi + mkdir -p $(BUILDDIR) + cp Dockerfile $(BUILDDIR) + cp -r overlay_$(ARCH) $(BUILDDIR)/overlay_$(ARCH) + cp -r overlay_common $(BUILDDIR)/overlay_common + mkdir -p $(BUILDDIR)/usr/bin + $(eval rpm_name := $(shell curl -s $(qemu_repo)/ --list-only | grep qemu-linux | sed -n s%".*>\(qemu-linux-.*rpm\).*"%"\1"%p | tail -1)) + curl -L $(qemu_repo)/$(rpm_name) -o $(BUILDDIR)/qemu-linux-user.rpm + @ if [[ $(ARCH) == "armv7l" ]]; then \ + rpm2cpio $(BUILDDIR)/qemu-linux-user.rpm | cpio -D $(BUILDDIR) -idmv "*qemu-arm" "*qemu-arm-*"; \ + fi + @ if [[ $(ARCH) == "aarch64" ]]; then \ + rpm2cpio $(BUILDDIR)/qemu-linux-user.rpm | cpio -D $(BUILDDIR) -idmv "*qemu-aarch*"; \ + fi + $(eval rootfs_file := $(shell curl -s $(root_repo) --list-only | sed -n s%".*>\(emby-base.*${ARCH}.*-.*tar.xz\).*"%"\1"%p | sort -i | head -1)) + curl -L $(root_repo)/$(rootfs_file) -o $(BUILDDIR)/rootfs.tar.xz + @ if [[ $(ARCH) == "x86_64" ]]; then \ + curl -L https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz -o $(BUILDDIR)/ffmpeg.tar.xz; \ + else \ + curl -L https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-armhf-static.tar.xz -o $(BUILDDIR)/ffmpeg.tar.xz; \ + fi + tar -C $(BUILDDIR)/usr/bin -xf $(BUILDDIR)/ffmpeg.tar.xz --wildcards "*/ffmpeg" --strip-components=1 + tar -C $(BUILDDIR)/usr/bin -xf $(BUILDDIR)/ffmpeg.tar.xz --wildcards "*/ffprobe" --strip-components=1 + @ if [[ ! -e /proc/sys/fs/binfmt_misc/arm || ! -e /proc/sys/fs/binfmt_misc/aarch64 ]]; then \ + docker run --rm --privileged emby/qemu-builder:register; \ + fi + cd $(BUILDDIR) && \ + docker build --build-arg ARCH=$(ARCH) --rm=true --tag=$(IMG_REPO)/$(IMG_NAME):$(ARCH) . + #rm -rf $(BUILDDIR) + #docker push $(IMG_REPO)/$(IMG_NAME):$(ARCH) -build: - @docker build \ - --rm=true \ - --tag=${APP_REPO}/${IMG_NAME} . - -base: build +end: + @echo "Done!" diff --git a/docker-containers/kiwi-images/arm_emby_server/emby.repo b/docker-containers/base/overlay-aarch64/etc/zypp/repos.d/emby.repo similarity index 100% rename from docker-containers/kiwi-images/arm_emby_server/emby.repo rename to docker-containers/base/overlay-aarch64/etc/zypp/repos.d/emby.repo diff --git a/docker-containers/base/overlay-aarch64/etc/zypp/repos.d/oss.repo b/docker-containers/base/overlay-aarch64/etc/zypp/repos.d/oss.repo new file mode 100644 index 0000000..bdcd42b --- /dev/null +++ b/docker-containers/base/overlay-aarch64/etc/zypp/repos.d/oss.repo @@ -0,0 +1,8 @@ +[oss] +name=openSUSE-Tumbleweed-Oss +enabled=1 +autorefresh=1 +baseurl=http://download.opensuse.org/ports/aarch64/tumbleweed/repo/oss/ +path=/ +type=yast2 +keeppackages=0 diff --git a/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/emby.repo b/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/emby.repo new file mode 100644 index 0000000..dcb3b0e --- /dev/null +++ b/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/emby.repo @@ -0,0 +1,7 @@ +[home_emby] +name=emby's Home Project (openSUSE_Factory_ARM) +type=rpm-md +baseurl=http://download.opensuse.org/repositories/home:/emby/openSUSE_Factory_ARM/ +gpgcheck=1 +gpgkey=http://download.opensuse.org/repositories/home:/emby/openSUSE_Factory_ARM//repodata/repomd.xml.key +enabled=1 diff --git a/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/oss.repo b/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/oss.repo new file mode 100644 index 0000000..60700a4 --- /dev/null +++ b/docker-containers/base/overlay-armv7l/etc/zypp/repos.d/oss.repo @@ -0,0 +1,8 @@ +[oss] +name=openSUSE-Tumbleweed-Oss +enabled=1 +autorefresh=1 +baseurl=http://download.opensuse.org/ports/armv7hl/tumbleweed/repo/oss/ +path=/ +type=yast2 +keeppackages=0 diff --git a/docker-containers/base/root/bin/instl b/docker-containers/base/overlay-common/bin/instl similarity index 100% rename from docker-containers/base/root/bin/instl rename to docker-containers/base/overlay-common/bin/instl diff --git a/docker-containers/base/root/bin/migrate_db b/docker-containers/base/overlay-common/bin/migrate_db similarity index 100% rename from docker-containers/base/root/bin/migrate_db rename to docker-containers/base/overlay-common/bin/migrate_db diff --git a/docker-containers/base/root/bin/uninstl b/docker-containers/base/overlay-common/bin/uninstl similarity index 100% rename from docker-containers/base/root/bin/uninstl rename to docker-containers/base/overlay-common/bin/uninstl diff --git a/docker-containers/base/root/bin/update b/docker-containers/base/overlay-common/bin/update similarity index 100% rename from docker-containers/base/root/bin/update rename to docker-containers/base/overlay-common/bin/update diff --git a/docker-containers/base/root/etc/cont-init.d/01-conf-onetime b/docker-containers/base/overlay-common/etc/cont-init.d/01-conf-onetime similarity index 100% rename from docker-containers/base/root/etc/cont-init.d/01-conf-onetime rename to docker-containers/base/overlay-common/etc/cont-init.d/01-conf-onetime diff --git a/docker-containers/base/root/etc/cont-init.d/02-user-onetime b/docker-containers/base/overlay-common/etc/cont-init.d/02-user-onetime similarity index 76% rename from docker-containers/base/root/etc/cont-init.d/02-user-onetime rename to docker-containers/base/overlay-common/etc/cont-init.d/02-user-onetime index db9b4cc..8ac4b78 100755 --- a/docker-containers/base/root/etc/cont-init.d/02-user-onetime +++ b/docker-containers/base/overlay-common/etc/cont-init.d/02-user-onetime @@ -40,6 +40,17 @@ if ! getent group emby > /dev/null; then fi CURR_SID=$(stat -c"%u:%g" ${APP_CONFIG}) -if [ "$CURR_SID" != "$APP_UID:$APP_GID" ] ; then +if [[ "$CURR_SID" != "$APP_UID:$APP_GID" ]] ; then chown -R $APP_UID:$APP_GID ${APP_CONFIG} fi + +# dri permissions +if [[ -e /dev/dri ]]; then + for dev_dri in /dev/dri/*; do + video_gid=$(stat -c %g ${dev_dri}) + if ! getent group ${video_gid} > /dev/null; then + groupadd -f -g ${video_gid} embyvideo + fi + usermod -aG ${video_gid} emby + done +fi diff --git a/docker-containers/base/root/etc/cont-init.d/03-upgrade-onetime b/docker-containers/base/overlay-common/etc/cont-init.d/03-upgrade-onetime similarity index 100% rename from docker-containers/base/root/etc/cont-init.d/03-upgrade-onetime rename to docker-containers/base/overlay-common/etc/cont-init.d/03-upgrade-onetime diff --git a/docker-containers/base/root/etc/services.d/emby-server/run b/docker-containers/base/overlay-common/etc/services.d/emby-server/run similarity index 100% rename from docker-containers/base/root/etc/services.d/emby-server/run rename to docker-containers/base/overlay-common/etc/services.d/emby-server/run diff --git a/docker-containers/base/root/var/cache/scripts/template b/docker-containers/base/overlay-common/var/cache/scripts/template similarity index 96% rename from docker-containers/base/root/var/cache/scripts/template rename to docker-containers/base/overlay-common/var/cache/scripts/template index 3edee78..5c2f650 100644 --- a/docker-containers/base/root/var/cache/scripts/template +++ b/docker-containers/base/overlay-common/var/cache/scripts/template @@ -69,12 +69,19 @@ prepare_docker_volume_parameters() { fi CURR_SID=$(stat -c"%u:%g" ${APP_CONFIG}) - if [ "$CURR_SID" != "$APP_UID:$APP_GID" ] ; then + if [[ "$CURR_SID" != "$APP_UID:$APP_GID" ]] ; then chown -R $APP_UID:$APP_GID ${APP_CONFIG} fi # prepare local filesystems VOLUMES+=" --volume=${APP_CONFIG}:${APP_GCONFIG}" + + # hardware volumes + if [[ -e "/dev/dri/" ]]; then + for dev in /dev/dri/* ; do + VOLUMES+=" --device=$dev:$dev" + done + fi } prepare_user_volume_parameters() { diff --git a/docker-containers/base/root/var/cache/systemd/template@service b/docker-containers/base/overlay-common/var/cache/systemd/template@service similarity index 100% rename from docker-containers/base/root/var/cache/systemd/template@service rename to docker-containers/base/overlay-common/var/cache/systemd/template@service diff --git a/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/emby.repo b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/emby.repo new file mode 100644 index 0000000..dcb3b0e --- /dev/null +++ b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/emby.repo @@ -0,0 +1,7 @@ +[home_emby] +name=emby's Home Project (openSUSE_Factory_ARM) +type=rpm-md +baseurl=http://download.opensuse.org/repositories/home:/emby/openSUSE_Factory_ARM/ +gpgcheck=1 +gpgkey=http://download.opensuse.org/repositories/home:/emby/openSUSE_Factory_ARM//repodata/repomd.xml.key +enabled=1 diff --git a/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/non-oss.repo b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/non-oss.repo new file mode 100644 index 0000000..390cf4c --- /dev/null +++ b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/non-oss.repo @@ -0,0 +1,8 @@ +[repo-non-oss] +name=openSUSE-Tumbleweed-Non-Oss +enabled=1 +autorefresh=1 +baseurl=http://download.opensuse.org/tumbleweed/repo/non-oss/ +path=/ +type=yast2 +keeppackages=0 diff --git a/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/oss.repo b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/oss.repo new file mode 100644 index 0000000..6dfc1d5 --- /dev/null +++ b/docker-containers/base/overlay-x86_64/etc/zypp/repos.d/oss.repo @@ -0,0 +1,8 @@ +[repo-oss] +name=openSUSE-Tumbleweed-Oss +enabled=1 +autorefresh=1 +baseurl=http://download.opensuse.org/tumbleweed/repo/oss/ +path=/ +type=yast2 +keeppackages=0 diff --git a/docker-containers/dev/Dockerfile b/docker-containers/dev/Dockerfile deleted file mode 100644 index d1dabf3..0000000 --- a/docker-containers/dev/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# Emby Server -FROM emby/emby-base -ENV APP_NAME="emby-server" IMG_NAME="embyserver" TAG_NAME="dev" PKG_NAME="emby-server-dev" EDGE=0 UMASK=002 - -RUN zypper --gpg-auto-import-keys ref \ - && zypper --non-interactive in $PKG_NAME \ - && zypper cc --all \ - && rm -rf /var/cache/zypp* - -VOLUME [ "/config" ] -EXPOSE 8096 8920 7359/udp 1900/udp - -ENTRYPOINT ["/init"] diff --git a/docker-containers/dev/Makefile b/docker-containers/dev/Makefile deleted file mode 100644 index 68f27c1..0000000 --- a/docker-containers/dev/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -all: build - -APP_NAME="emby-server" -IMG_NAME="embyserver" -TAG_NAME="dev" - -ifndef APP_REPO -APP_REPO=${USER} -endif - -ENV_VARS= \ - --env="APP_REPO=${APP_REPO}" \ - --env="APP_USER=${USER}" \ - --env="APP_UID=$(shell id -u)" \ - --env="APP_GID=$(shell id -g)" \ - --env="IMG_NAME=${IMG_NAME}" \ - --env="TAG_NAME=${TAG_NAME}" - -ifdef APP_CONFIG -INSTL_VARS= \ - --env="APP_CONFIG=${APP_CONFIG}" -endif - -help: - @echo "" - @echo "-- Help Menu" - @echo "" - @echo " 1. make build - build the ${APP_NAME} base image" - @echo " 2. make clean - remove the ${APP_NAME} base image and containers" - @echo " 3. make install - install ${APP_NAME} wrapper script for docker" - @echo " 4. make ${APP_NAME} - build ${APP_NAME} image and run" - @echo "" - -clean: - @docker rm -f `docker ps -a | grep "${APP_REPO}/${IMG_NAME}" | awk '{print $$1}'` > /dev/null 2>&1 || exit 0 - @docker rmi `docker images | grep -e "${APP_REPO}/${IMG_NAME}.*${TAG_NAME}" | awk '{print $$3}'` > /dev/null 2>&1 || exit 0 - -build: - @docker build --rm=true --tag=${APP_REPO}/${IMG_NAME}:${TAG_NAME} . - -instl uninstl: clean build - @docker run -it --rm \ - -v /usr/local/bin:/target \ - ${ENV_VARS} \ - ${INSTL_VARS} \ - ${APP_REPO}/${IMG_NAME}:${TAG_NAME} $@ - -service: build - @docker run -it --rm \ - -v /etc/systemd/system:/target \ - ${ENV_VARS} \ - ${APP_REPO}/${IMG_NAME}:${TAG_NAME} instl service diff --git a/docker-containers/kiwi-images/arm_devel/01-conf-onetime b/docker-containers/kiwi-images/arm_devel/01-conf-onetime deleted file mode 100644 index d3012c1..0000000 --- a/docker-containers/kiwi-images/arm_devel/01-conf-onetime +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/with-contenv sh -# vim:set ft=sh sw=2 sts=2 st=2 et: - -find /etc/zypp/repos.d/ -type f | grep -v emby | grep -v "$(uname -a )" | xargs -I {} rm {} ; - -# grab source -if [[ -d "/var/tmp/source/build-root" ]]; then - cp -R /var/tmp/source/build-root /var/tmp/ -fi diff --git a/docker-containers/kiwi-images/arm_devel/Makefile b/docker-containers/kiwi-images/arm_devel/Makefile deleted file mode 100644 index 20ea5ca..0000000 --- a/docker-containers/kiwi-images/arm_devel/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -#/usr/bin/make -f - -SHELL := /bin/bash - -current_dir := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) -current_s6_overlay := $(shell curl -sSL https://github.com/just-containers/s6-overlay/releases.atom | sed -n s/"^\(\s\+\)\(v[^<]*\).*$$"/"\2"/p | head -1) -tumbleweed_root = "https://github.com/openSUSE/docker-containers/blob/master/openSUSE-Tumbleweed/root.tar.bz2?raw=true" -container_dir := $(shell dirname $(shell dirname $(current_dir))) - -%:: all - - -all: clean build - -clean: -ifneq ("$(wildcard $(current_dir)/root.tar.bz2)","") - rm $(current_dir)/root.tar.bz2 -endif -ifneq ("$(wildcard $(current_dir)/s6-overlay-armhf.tar.gz)","") - rm $(current_dir)/s6-overlay-armhf.tar.gz -endif -ifneq ("$(wildcard $(current_dir)/root)","") - rm -rf $(current_dir)/root -endif - -build: - curl -sSL ${tumbleweed_root} -o root.tar.bz2 - curl -sSOL https://github.com/just-containers/s6-overlay/releases/download/$(current_s6_overlay)/s6-overlay-armhf.tar.gz - mkdir -p $(current_dir)/root - tar -C $(current_dir)/root -xf root.tar.bz2 - tar -C $(current_dir)/root -xf s6-overlay-armhf.tar.gz - rm $(current_dir)/root.tar.bz2 - rm $(current_dir)/root/etc/zypp/repos.d/* - cp $(current_dir)/*.repo $(current_dir)/root/etc/zypp/repos.d/ - cp $(current_dir)/01-conf-onetime $(current_dir)/root/etc/cont-init.d/ - tar -cjf $(current_dir)/root.tar.bz2 --owner 0 --group 0 -C $(current_dir)/root . - @ if [[ -d $(current_dir)/root ]]; then \ - rm -r $(current_dir)/root; \ - fi - @ if [[ -f $(current_dir)/s6-overlay-armhf.tar.gz ]]; then \ - rm $(current_dir)/s6-overlay-armhf.tar.gz; \ - fi diff --git a/docker-containers/kiwi-images/arm_devel/oss-aarch64.repo b/docker-containers/kiwi-images/arm_devel/oss-aarch64.repo deleted file mode 100644 index 626d4b7..0000000 --- a/docker-containers/kiwi-images/arm_devel/oss-aarch64.repo +++ /dev/null @@ -1,8 +0,0 @@ -[oss] -name=OSS -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/ports/aarch64/factory/repo/oss/ -path=/ -type=yast2 -keeppackages=0 diff --git a/docker-containers/kiwi-images/arm_devel/oss-armv7l.repo b/docker-containers/kiwi-images/arm_devel/oss-armv7l.repo deleted file mode 100644 index b83c5ec..0000000 --- a/docker-containers/kiwi-images/arm_devel/oss-armv7l.repo +++ /dev/null @@ -1,8 +0,0 @@ -[oss] -name=OSS-armv7hl -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/ports/armv7hl/factory/repo/oss/ -path=/ -type=yast2 -keeppackages=0 diff --git a/docker-containers/kiwi-images/arm_devel/root.tar.bz2 b/docker-containers/kiwi-images/arm_devel/root.tar.bz2 deleted file mode 100644 index b340598..0000000 Binary files a/docker-containers/kiwi-images/arm_devel/root.tar.bz2 and /dev/null differ diff --git a/docker-containers/kiwi-images/arm_emby_server/04-ffmpeg-onetime b/docker-containers/kiwi-images/arm_emby_server/04-ffmpeg-onetime deleted file mode 100644 index bb59f3f..0000000 --- a/docker-containers/kiwi-images/arm_emby_server/04-ffmpeg-onetime +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bash -# vim:set ft=sh sw=2 sts=2 st=2 et: - -curl -sL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-armhf-32bit-static.tar.xz | \ - tar -C /bin --extract -J --wildcards "*/ffmpeg" --wildcards "*/ffprobe" --strip-components=1 diff --git a/docker-containers/kiwi-images/arm_emby_server/05-repos-onetime b/docker-containers/kiwi-images/arm_emby_server/05-repos-onetime deleted file mode 100644 index 3bdd367..0000000 --- a/docker-containers/kiwi-images/arm_emby_server/05-repos-onetime +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/with-contenv sh -# vim:set ft=sh sw=2 sts=2 st=2 et: - -find /etc/zypp/repos.d/ -type f | grep -v emby | grep -v "$(uname -a )" | xargs -I {} rm {} ; diff --git a/docker-containers/kiwi-images/arm_emby_server/Makefile b/docker-containers/kiwi-images/arm_emby_server/Makefile deleted file mode 100644 index d1fd4c3..0000000 --- a/docker-containers/kiwi-images/arm_emby_server/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -#/usr/bin/make -f - -SHELL := /bin/bash - -current_dir := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) -current_s6_overlay := $(shell curl -sSL https://github.com/just-containers/s6-overlay/releases.atom | sed -n s/"^\(\s\+<title>\)\(v[^<]*\).*$$"/"\2"/p | head -1) -tumbleweed_root = "https://github.com/openSUSE/docker-containers/blob/master/openSUSE-Tumbleweed/root.tar.bz2?raw=true" -container_dir := $(shell dirname $(shell dirname $(current_dir))) - -%:: all - - -all: clean build - -clean: -ifneq ("$(wildcard $(current_dir)/root.tar.bz2)","") - rm $(current_dir)/root.tar.bz2 -endif -ifneq ("$(wildcard $(current_dir)/s6-overlay-armhf.tar.gz)","") - rm $(current_dir)/s6-overlay-armhf.tar.gz -endif -ifneq ("$(wildcard $(current_dir)/root)","") - rm -rf $(current_dir)/root -endif - -build: - curl -sSL ${tumbleweed_root} -o root.tar.bz2 - curl -sSOL https://github.com/just-containers/s6-overlay/releases/download/$(current_s6_overlay)/s6-overlay-armhf.tar.gz - cp -r $(container_dir)/base/root $(current_dir) - tar -C $(current_dir)/root -xf root.tar.bz2 - tar -C $(current_dir)/root -xf s6-overlay-armhf.tar.gz - rm $(current_dir)/root.tar.bz2 - rm $(current_dir)/root/etc/zypp/repos.d/* - cp $(current_dir)/*.repo $(current_dir)/root/etc/zypp/repos.d/ - cp $(current_dir)/*-onetime $(current_dir)/root/etc/cont-init.d/ - tar -cjf $(current_dir)/root.tar.bz2 --owner 0 --group 0 -C $(current_dir)/root . - @ if [[ -d $(current_dir)/root ]]; then \ - rm -r $(current_dir)/root; \ - fi - @ if [[ -f $(current_dir)/s6-overlay-armhf.tar.gz ]]; then \ - rm $(current_dir)/s6-overlay-armhf.tar.gz; \ - fi diff --git a/docker-containers/kiwi-images/arm_emby_server/oss-aarch64.repo b/docker-containers/kiwi-images/arm_emby_server/oss-aarch64.repo deleted file mode 100644 index 626d4b7..0000000 --- a/docker-containers/kiwi-images/arm_emby_server/oss-aarch64.repo +++ /dev/null @@ -1,8 +0,0 @@ -[oss] -name=OSS -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/ports/aarch64/factory/repo/oss/ -path=/ -type=yast2 -keeppackages=0 diff --git a/docker-containers/kiwi-images/arm_emby_server/oss-armv7l.repo b/docker-containers/kiwi-images/arm_emby_server/oss-armv7l.repo deleted file mode 100644 index b83c5ec..0000000 --- a/docker-containers/kiwi-images/arm_emby_server/oss-armv7l.repo +++ /dev/null @@ -1,8 +0,0 @@ -[oss] -name=OSS-armv7hl -enabled=1 -autorefresh=1 -baseurl=http://download.opensuse.org/ports/armv7hl/factory/repo/oss/ -path=/ -type=yast2 -keeppackages=0 diff --git a/docker-containers/kiwi-images/arm_emby_server/root.tar.bz2 b/docker-containers/kiwi-images/arm_emby_server/root.tar.bz2 deleted file mode 100644 index 4d3afa5..0000000 Binary files a/docker-containers/kiwi-images/arm_emby_server/root.tar.bz2 and /dev/null differ diff --git a/docker-containers/kiwi-images/arm_devel/LICENSE b/docker-containers/kiwi-images/base/LICENSE similarity index 100% rename from docker-containers/kiwi-images/arm_devel/LICENSE rename to docker-containers/kiwi-images/base/LICENSE diff --git a/docker-containers/kiwi-images/arm_devel/README.md b/docker-containers/kiwi-images/base/README.md similarity index 100% rename from docker-containers/kiwi-images/arm_devel/README.md rename to docker-containers/kiwi-images/base/README.md diff --git a/docker-containers/kiwi-images/arm_emby_server/config.kiwi b/docker-containers/kiwi-images/base/config.kiwi similarity index 95% rename from docker-containers/kiwi-images/arm_emby_server/config.kiwi rename to docker-containers/kiwi-images/base/config.kiwi index f17a829..bae84c1 100644 --- a/docker-containers/kiwi-images/arm_emby_server/config.kiwi +++ b/docker-containers/kiwi-images/base/config.kiwi @@ -44,7 +44,6 @@ <package name="dejavu-fonts"/> <package name="dracut"/> <package name="elfutils"/> - <package name="emby-server"/> <package name="embymagick"/> <package name="filesystem"/> <package name="glibc-locale"/> @@ -60,10 +59,13 @@ <package name="mono-winfxcore"/> <package name="ncurses-utils"/> <package name="pkg-config"/> + <package name="s6"/> + <package name="s6-overlay"/> + <package name="s6-portable-utils"/> + <package name="s6-rc"/> <package name="sg3_utils"/> <package name="sudo"/> <package name="tar"/> - <package name="tar"/> <package name="timezone"/> <package name="xz"/> </packages> diff --git a/docker-containers/kiwi-images/arm_devel/config.sh b/docker-containers/kiwi-images/base/config.sh similarity index 83% rename from docker-containers/kiwi-images/arm_devel/config.sh rename to docker-containers/kiwi-images/base/config.sh index f19102d..58fc26a 100644 --- a/docker-containers/kiwi-images/arm_devel/config.sh +++ b/docker-containers/kiwi-images/base/config.sh @@ -54,7 +54,9 @@ sed -i 's/.*installRecommends.*/installRecommends = no/g' /etc/zypp/zypper.conf #====================================== # Remove locale files #-------------------------------------- -(cd /usr/share/locale && ls | grep -ve "en_US*" | xargs rm -rf && find -name '*.mo' | grep -ve "en_US*" | xargs rm -rf) - +(pushd /usr/share/locale && find -name '*.mo' | xargs rm && popd) +(pushd /usr/lib/locale && find -maxdepth 1 -type d ! -name "C.utf8" -exec rm -rf {} \; && popd) +(pushd /usr/ && find -type d -name "gconv" -exec rm -rf {} \; && popd) +(pushd /etc/zypp/repos.d && find -type f -exec rm -rf {} \; && popd) exit 0 diff --git a/docker-containers/kiwi-images/base/root.tar.bz2 b/docker-containers/kiwi-images/base/root.tar.bz2 new file mode 100644 index 0000000..a332492 Binary files /dev/null and b/docker-containers/kiwi-images/base/root.tar.bz2 differ diff --git a/docker-containers/kiwi-images/arm_emby_server/LICENSE b/docker-containers/kiwi-images/devel/LICENSE similarity index 100% rename from docker-containers/kiwi-images/arm_emby_server/LICENSE rename to docker-containers/kiwi-images/devel/LICENSE diff --git a/docker-containers/kiwi-images/arm_emby_server/README.md b/docker-containers/kiwi-images/devel/README.md similarity index 100% rename from docker-containers/kiwi-images/arm_emby_server/README.md rename to docker-containers/kiwi-images/devel/README.md diff --git a/docker-containers/kiwi-images/arm_devel/config.kiwi b/docker-containers/kiwi-images/devel/config.kiwi similarity index 95% rename from docker-containers/kiwi-images/arm_devel/config.kiwi rename to docker-containers/kiwi-images/devel/config.kiwi index 5dfc0f7..29dbcc8 100644 --- a/docker-containers/kiwi-images/arm_devel/config.kiwi +++ b/docker-containers/kiwi-images/devel/config.kiwi @@ -61,6 +61,10 @@ <package name="patch"/> <package name="pkg-config"/> <package name="python"/> + <package name="s6"/> + <package name="s6-overlay"/> + <package name="s6-portable-utils"/> + <package name="s6-rc"/> <package name="sg3_utils"/> <package name="sudo"/> <package name="tar"/> diff --git a/docker-containers/kiwi-images/arm_emby_server/config.sh b/docker-containers/kiwi-images/devel/config.sh similarity index 83% rename from docker-containers/kiwi-images/arm_emby_server/config.sh rename to docker-containers/kiwi-images/devel/config.sh index f19102d..58fc26a 100644 --- a/docker-containers/kiwi-images/arm_emby_server/config.sh +++ b/docker-containers/kiwi-images/devel/config.sh @@ -54,7 +54,9 @@ sed -i 's/.*installRecommends.*/installRecommends = no/g' /etc/zypp/zypper.conf #====================================== # Remove locale files #-------------------------------------- -(cd /usr/share/locale && ls | grep -ve "en_US*" | xargs rm -rf && find -name '*.mo' | grep -ve "en_US*" | xargs rm -rf) - +(pushd /usr/share/locale && find -name '*.mo' | xargs rm && popd) +(pushd /usr/lib/locale && find -maxdepth 1 -type d ! -name "C.utf8" -exec rm -rf {} \; && popd) +(pushd /usr/ && find -type d -name "gconv" -exec rm -rf {} \; && popd) +(pushd /etc/zypp/repos.d && find -type f -exec rm -rf {} \; && popd) exit 0 diff --git a/docker-containers/kiwi-images/devel/root.tar.bz2 b/docker-containers/kiwi-images/devel/root.tar.bz2 new file mode 100644 index 0000000..a332492 Binary files /dev/null and b/docker-containers/kiwi-images/devel/root.tar.bz2 differ diff --git a/docker-containers/qemu-builder/arm/Dockerfile b/docker-containers/qemu-builder/arm/Dockerfile deleted file mode 100644 index 0de6bdc..0000000 --- a/docker-containers/qemu-builder/arm/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Qemu Builder for arm archs -FROM scratch -MAINTAINER Carlos Hernandez <carlos@techbyte.ca> -ENV LANG="en_US.UTF-8" - -ADD rootfs.tar.xz / - -COPY usr/ /usr/ - -ENTRYPOINT ["/init"] -WORKDIR /var/tmp/build-root -CMD make && tar cJvf /ffmpeg_$(uname -m).tar.xz -C /var/tmp/ffmpeg . diff --git a/docker-containers/qemu-builder/arm/Makefile b/docker-containers/qemu-builder/arm/Makefile deleted file mode 100644 index 43d1b68..0000000 --- a/docker-containers/qemu-builder/arm/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/make -f - -SHELL := /bin/bash - -repo := "http://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64" -all: armv7 aarch64 -.PHONY: all armv7 aarch64 end - -armv7: ARCH := "armv7" -aarch64: ARCH := "aarch64" -armv7 aarch64: - @echo "Building $(ARCH)" - $(eval img_name := $(shell curl -s http://download.opensuse.org/repositories/home:/emby:/docker/images/ --list-only | grep devel | sed -n s%".*>\(.*${ARCH}.*-.*tar.xz\)</a>.*"%"\1"%p | sort -i | head -1)) - curl -L http://download.opensuse.org/repositories/home:/emby:/docker/images/$(img_name) -o rootfs.tar.xz - $(eval rpm_name := $(shell curl -s $(repo)/ --list-only | grep qemu-linux | sed -n s%".*>\(qemu-linux-.*rpm\)</a>.*"%"\1"%p)) - curl -L $(repo)/$(rpm_name) -o qemu-linux-user.rpm - @ if [[ $(ARCH) == "armv7" ]]; then \ - rpm2cpio qemu-linux-user.rpm | cpio -idmv "*qemu-arm*"; \ - else \ - rpm2cpio qemu-linux-user.rpm | cpio -idmv "*qemu-aarch*"; \ - fi - docker build --rm=true --tag=emby/qemu-builder:$(ARCH) . - docker push emby/qemu-builder:$(ARCH) - docker rmi emby/qemu-builder:$(ARCH) - rm rootfs.tar.xz - rm qemu-linux-user.rpm - rm -rf root/ - rm -rf usr/ - -end: - @echo "Done!" diff --git a/docker-containers/qemu-builder/register/Dockerfile b/docker-containers/qemu-register/Dockerfile similarity index 100% rename from docker-containers/qemu-builder/register/Dockerfile rename to docker-containers/qemu-register/Dockerfile diff --git a/docker-containers/qemu-builder/register/Makefile b/docker-containers/qemu-register/Makefile similarity index 100% rename from docker-containers/qemu-builder/register/Makefile rename to docker-containers/qemu-register/Makefile diff --git a/docker-containers/qemu-builder/register/README.md b/docker-containers/qemu-register/README.md similarity index 100% rename from docker-containers/qemu-builder/register/README.md rename to docker-containers/qemu-register/README.md diff --git a/docker-containers/qemu-builder/register/root/usr/sbin/qemu-binfmt-register.sh b/docker-containers/qemu-register/root/usr/sbin/qemu-binfmt-register.sh similarity index 100% rename from docker-containers/qemu-builder/register/root/usr/sbin/qemu-binfmt-register.sh rename to docker-containers/qemu-register/root/usr/sbin/qemu-binfmt-register.sh