2019-03-16 05:47:14 +00:00
|
|
|
FROM alpine:3.9 as rootfs-stage
|
|
|
|
MAINTAINER sparkyballs,thelamer
|
|
|
|
|
|
|
|
# environment
|
|
|
|
ENV REL=bionic
|
|
|
|
ENV ARCH=amd64
|
|
|
|
# install packages
|
|
|
|
RUN \
|
|
|
|
apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
curl \
|
|
|
|
tzdata \
|
|
|
|
xz
|
|
|
|
|
|
|
|
# grab base tarball
|
|
|
|
RUN \
|
|
|
|
mkdir /root-out && \
|
|
|
|
curl -o \
|
|
|
|
/rootfs.tar.gz -L \
|
|
|
|
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
|
|
|
tar xf \
|
|
|
|
/rootfs.tar.gz -C \
|
|
|
|
/root-out
|
|
|
|
|
|
|
|
# Runtime stage
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=rootfs-stage /root-out/ /
|
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
|
|
LABEL MAINTAINER="sparkyballs,TheLamer"
|
2016-07-01 02:46:36 +00:00
|
|
|
|
|
|
|
# set version for s6 overlay
|
2019-03-16 06:54:02 +00:00
|
|
|
ARG OVERLAY_VERSION="v1.22.0.0"
|
2016-07-09 12:44:56 +00:00
|
|
|
ARG OVERLAY_ARCH="amd64"
|
2016-07-01 02:46:36 +00:00
|
|
|
|
2019-03-16 05:47:14 +00:00
|
|
|
# set environment variables
|
2016-10-07 00:26:16 +00:00
|
|
|
ARG DEBIAN_FRONTEND="noninteractive"
|
|
|
|
ENV HOME="/root" \
|
2017-03-15 00:38:21 +00:00
|
|
|
LANGUAGE="en_US.UTF-8" \
|
|
|
|
LANG="en_US.UTF-8" \
|
2016-10-07 00:26:16 +00:00
|
|
|
TERM="xterm"
|
2017-03-15 00:40:48 +00:00
|
|
|
|
2019-03-16 05:47:14 +00:00
|
|
|
# copy sources
|
2016-09-04 12:52:26 +00:00
|
|
|
COPY sources.list /etc/apt/
|
|
|
|
|
2016-07-01 02:46:36 +00:00
|
|
|
RUN \
|
2019-03-16 05:47:14 +00:00
|
|
|
echo "**** Ripped from Ubuntu Docker Logic ****" && \
|
|
|
|
set -xe && \
|
|
|
|
echo '#!/bin/sh' \
|
|
|
|
> /usr/sbin/policy-rc.d && \
|
|
|
|
echo 'exit 101' \
|
|
|
|
>> /usr/sbin/policy-rc.d && \
|
|
|
|
chmod +x \
|
|
|
|
/usr/sbin/policy-rc.d && \
|
|
|
|
dpkg-divert --local --rename --add /sbin/initctl && \
|
|
|
|
cp -a \
|
|
|
|
/usr/sbin/policy-rc.d \
|
|
|
|
/sbin/initctl && \
|
|
|
|
sed -i \
|
|
|
|
's/^exit.*/exit 0/' \
|
|
|
|
/sbin/initctl && \
|
|
|
|
echo 'force-unsafe-io' \
|
|
|
|
> /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \
|
|
|
|
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \
|
|
|
|
> /etc/apt/apt.conf.d/docker-clean && \
|
|
|
|
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \
|
|
|
|
>> /etc/apt/apt.conf.d/docker-clean && \
|
|
|
|
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' \
|
|
|
|
>> /etc/apt/apt.conf.d/docker-clean && \
|
|
|
|
echo 'Acquire::Languages "none";' \
|
|
|
|
> /etc/apt/apt.conf.d/docker-no-languages && \
|
|
|
|
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' \
|
|
|
|
> /etc/apt/apt.conf.d/docker-gzip-indexes && \
|
|
|
|
echo 'Apt::AutoRemove::SuggestsImportant "false";' \
|
|
|
|
> /etc/apt/apt.conf.d/docker-autoremove-suggests && \
|
|
|
|
mkdir -p /run/systemd && \
|
|
|
|
echo 'docker' \
|
|
|
|
> /run/systemd/container && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** install apt-utils and locales ****" && \
|
2016-07-01 02:46:36 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y \
|
2017-04-14 22:23:51 +00:00
|
|
|
apt-utils \
|
|
|
|
locales && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** install packages ****" && \
|
2016-07-01 02:46:36 +00:00
|
|
|
apt-get install -y \
|
2017-04-17 13:38:03 +00:00
|
|
|
curl \
|
|
|
|
tzdata && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** generate locale ****" && \
|
2017-04-14 22:23:51 +00:00
|
|
|
locale-gen en_US.UTF-8 && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** add s6 overlay ****" && \
|
2016-07-01 02:46:36 +00:00
|
|
|
curl -o \
|
2016-07-09 12:44:56 +00:00
|
|
|
/tmp/s6-overlay.tar.gz -L \
|
2016-10-07 00:26:16 +00:00
|
|
|
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \
|
|
|
|
tar xfz \
|
|
|
|
/tmp/s6-overlay.tar.gz -C / && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** create abc user and make our folders ****" && \
|
2016-10-07 00:26:16 +00:00
|
|
|
useradd -u 911 -U -d /config -s /bin/false abc && \
|
|
|
|
usermod -G users abc && \
|
|
|
|
mkdir -p \
|
|
|
|
/app \
|
|
|
|
/config \
|
|
|
|
/defaults && \
|
2017-12-07 07:51:52 +00:00
|
|
|
echo "**** cleanup ****" && \
|
2016-07-01 02:46:36 +00:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/tmp/*
|
|
|
|
|
|
|
|
# add local files
|
|
|
|
COPY root/ /
|
|
|
|
|
|
|
|
ENTRYPOINT ["/init"]
|