Layering hostname/hosts (#5)

* Layering hostname/hosts

* Fix build

* Use origin files on new overlay
This commit is contained in:
Pascal Vizeli 2018-04-27 18:20:06 +02:00 committed by GitHub
parent 5a6b8c5bbe
commit e544c14d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 3 deletions

View File

@ -55,11 +55,11 @@ mkdir -p /mnt/supervisor
mkdir -p /mnt/cli
# Run dockerd
dockerd -s overlay2 -g /mnt/docker 2> /dev/null &
dockerd -s overlay2 -g /mnt/docker &
DOCKER_PID=$!
DOCKER_COUNT=0
until docker info >/dev/null 2>&1; do
DOCKER_COUNT=0
if [ ${DOCKER_COUNT} -gt 30 ]; then
exit 1
fi

View File

@ -0,0 +1 @@
/usr/lib/systemd/system/etc-hostname.mount

View File

@ -0,0 +1 @@
/usr/lib/systemd/system/etc-hosts.mount

View File

@ -0,0 +1,2 @@
C /mnt/overlay/etc/hostname - - - - /etc/hostname
C /mnt/overlay/etc/hosts - - - - /etc/hosts

View File

@ -0,0 +1,14 @@
[Unit]
Description=Hostname persistent configuration
Requires=mnt-overlay.mount
After=mnt-overlay.mount systemd-tmpfiles-setup.service
Before=network.target
[Mount]
What=/mnt/overlay/etc/hostname
Where=/etc/hostname
Type=none
Options=bind
[Install]
WantedBy=hassio-bind.target

View File

@ -0,0 +1,14 @@
[Unit]
Description=Hosts persistent configuration
Requires=mnt-overlay.mount
After=mnt-overlay.mount systemd-tmpfiles-setup.service
Before=network.target
[Mount]
What=/mnt/overlay/etc/hosts
Where=/etc/hosts
Type=none
Options=bind
[Install]
WantedBy=hassio-bind.target

View File

@ -1,7 +1,7 @@
[Unit]
Description=Hassio overlay partition
DefaultDependencies=no
Before=umount.target
Before=umount.target systemd-tmpfiles-setup.service
Conflicts=umount.target
[Mount]

View File

@ -1,3 +1,4 @@
#!/bin/bash
modprobe overlayfs
docker build -t hassbuildroot .
docker run -it --rm --privileged -v "$(pwd):/build" hassbuildroot bash