Combine init and prepare scripts
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
source /build/config
|
|
||||||
set -x
|
|
||||||
|
|
||||||
## Install init process
|
|
||||||
mkdir -p /opt/init.d
|
|
||||||
mkdir -p /etc/container_environment
|
|
||||||
touch /etc/container_environment.sh
|
|
||||||
touch /etc/container_environment.json
|
|
||||||
chmod 700 /etc/container_environment
|
|
||||||
chmod 600 /etc/container_environment.sh /etc/container_environment.json
|
|
||||||
@@ -3,38 +3,42 @@ set -e
|
|||||||
source /build/config
|
source /build/config
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Create directories
|
## Create directories and files
|
||||||
mkdir /etc/container_environment
|
mkdir /etc/container_environment
|
||||||
mkdir /opt/init.d
|
mkdir /opt/init.d
|
||||||
|
touch /etc/container_environment.sh
|
||||||
|
touch /etc/container_environment.json
|
||||||
|
chmod 700 /etc/container_environment
|
||||||
|
chmod 600 /etc/container_environment.sh /etc/container_environment.json
|
||||||
|
|
||||||
## Temporarily disable dpkg fsync to make building faster.
|
# Temporarily disable dpkg fsync to make building faster.
|
||||||
echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02apt-speedup
|
echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02apt-speedup
|
||||||
|
|
||||||
## Prevent initramfs updates from trying to run grub and lilo.
|
# Prevent initramfs updates from trying to run grub and lilo.
|
||||||
## https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
|
# https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
|
||||||
## http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594189
|
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594189
|
||||||
export_env INITRD no
|
export_env INITRD no
|
||||||
|
|
||||||
## Enable sources and backports in APT
|
# Enable sources and backports in APT
|
||||||
echo 'deb-src http://httpredir.debian.org/debian/ jessie main' >> /etc/apt/sources.list
|
echo 'deb-src http://httpredir.debian.org/debian/ jessie main' >> /etc/apt/sources.list
|
||||||
echo 'deb http://httpredir.debian.org/debian/ jessie-backports main contrib non-free' >> /etc/apt/sources.list
|
echo 'deb http://httpredir.debian.org/debian/ jessie-backports main contrib non-free' >> /etc/apt/sources.list
|
||||||
echo 'deb-src http://httpredir.debian.org/debian/ jessie-backports main contrib non-free' >> /etc/apt/sources.list
|
echo 'deb-src http://httpredir.debian.org/debian/ jessie-backports main contrib non-free' >> /etc/apt/sources.list
|
||||||
apt update
|
apt update
|
||||||
|
|
||||||
## Fix some issues with APT packages
|
## Fix some issues with APT packages
|
||||||
## See https://github.com/dotcloud/docker/issues/1024
|
# See https://github.com/dotcloud/docker/issues/1024
|
||||||
dpkg-divert --local --rename --add /sbin/initctl
|
dpkg-divert --local --rename --add /sbin/initctl
|
||||||
ln -sf /bin/true /sbin/initctl
|
ln -sf /bin/true /sbin/initctl
|
||||||
|
|
||||||
## Replace the 'ischroot' tool to make it always return true
|
# Replace the 'ischroot' tool to make it always return true
|
||||||
## Prevent initscripts updates from breaking /dev/shm
|
# Prevent initscripts updates from breaking /dev/shm
|
||||||
## https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
|
# https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
|
||||||
## https://bugs.launchpad.net/launchpad/+bug/974584
|
# https://bugs.launchpad.net/launchpad/+bug/974584
|
||||||
dpkg-divert --local --rename --add /usr/bin/ischroot
|
dpkg-divert --local --rename --add /usr/bin/ischroot
|
||||||
ln -sf /bin/true /usr/bin/ischroot
|
ln -sf /bin/true /usr/bin/ischroot
|
||||||
|
|
||||||
## Fix known issue with user accounts
|
# Fix known issue with user accounts
|
||||||
## https://github.com/docker/docker/issues/6345#issuecomment-49245365
|
# https://github.com/docker/docker/issues/6345#issuecomment-49245365
|
||||||
ln -sf /bin/true /usr/bin/chfn
|
ln -sf /bin/true /usr/bin/chfn
|
||||||
|
|
||||||
## Install HTTPS support for APT
|
## Install HTTPS support for APT
|
||||||
|
|||||||
Reference in New Issue
Block a user