Skip to content

Commit

Permalink
Reworking docker build and kiwi images
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Hernandez committed May 18, 2017
1 parent a34581f commit 986507b
Show file tree
Hide file tree
Showing 52 changed files with 141 additions and 370 deletions.
4 changes: 2 additions & 2 deletions builders/emby-server/debian/jessie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ MAINTAINER HurricaneHrndz <carlos@techbyte.ca>
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 \
Expand Down
4 changes: 2 additions & 2 deletions builders/emby-server/ubuntu/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ MAINTAINER HurricaneHrndz <carlos@techbyte.ca>
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 \
Expand Down
11 changes: 0 additions & 11 deletions docker-containers/arm/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions docker-containers/arm/Makefile

This file was deleted.

72 changes: 7 additions & 65 deletions docker-containers/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,9 @@
FROM opensuse/amd64:tumbleweed
FROM scratch
MAINTAINER Carlos Hernandez <carlos@techbyte.ca>
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/
68 changes: 48 additions & 20 deletions docker-containers/base/Makefile
Original file line number Diff line number Diff line change
@@ -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\)</a>.*"%"\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\)</a>.*"%"\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!"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions docker-containers/dev/Dockerfile

This file was deleted.

52 changes: 0 additions & 52 deletions docker-containers/dev/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions docker-containers/kiwi-images/arm_devel/01-conf-onetime

This file was deleted.

Loading

0 comments on commit 986507b

Please sign in to comment.