Created
July 5, 2018 08:07
-
-
Save henrich/756a47ea5877eeba8dacc9779803bd93 to your computer and use it in GitHub Desktop.
docker support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 9790b28ec589485ebb450344d66cfae1bd19dcde Mon Sep 17 00:00:00 2001 | |
From: Hideki Yamane <[email protected]> | |
Date: Thu, 5 Jul 2018 17:06:25 +0900 | |
Subject: [PATCH] Add docker support (Closes: #890867) | |
--- | |
functions | 4 +++- | |
scripts/aequorea | 4 ++-- | |
scripts/debian-common | 4 ++-- | |
scripts/edgy | 4 ++-- | |
scripts/feisty | 4 ++-- | |
scripts/gutsy | 4 ++-- | |
scripts/sarge.fakechroot | 2 +- | |
7 files changed, 14 insertions(+), 12 deletions(-) | |
diff --git a/functions b/functions | |
index 4003ed2..b510c0c 100644 | |
--- a/functions | |
+++ b/functions | |
@@ -226,6 +226,8 @@ detect_container () { | |
CONTAINER="lxc-libvirt" | |
elif grep -qs ^systemd-nspawn$ /run/systemd/container || [ "$container" = "systemd-nspawn" ]; then | |
CONTAINER="systemd-nspawn" | |
+ elif grep -qs '[[:space:]]/docker/.*/sys/fs/cgroup' /proc/1/mountinfo; then | |
+ CONTAINER="docker" | |
else | |
CONTAINER="" | |
fi | |
@@ -1156,7 +1158,7 @@ setup_proc () { | |
umount_on_exit /lib/init/rw | |
} | |
-setup_proc_fakechroot () { | |
+setup_proc_symlink () { | |
rm -rf "$TARGET/proc" | |
ln -s /proc "$TARGET" | |
} | |
diff --git a/scripts/aequorea b/scripts/aequorea | |
index 1ae17d8..8c68983 100644 | |
--- a/scripts/aequorea | |
+++ b/scripts/aequorea | |
@@ -89,8 +89,8 @@ second_stage_install () { | |
baseprog="$(($baseprog + ${1:-1}))" | |
} | |
- if doing_variant fakechroot; then | |
- setup_proc_fakechroot | |
+ if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then | |
+ setup_proc_symlink | |
else | |
setup_proc | |
in_target /sbin/ldconfig | |
diff --git a/scripts/debian-common b/scripts/debian-common | |
index 211a4c4..a2acd36 100644 | |
--- a/scripts/debian-common | |
+++ b/scripts/debian-common | |
@@ -65,8 +65,8 @@ first_stage_install () { | |
setup_devices | |
- if doing_variant fakechroot; then | |
- setup_proc_fakechroot | |
+ if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then | |
+ setup_proc_symlink | |
fi | |
} | |
diff --git a/scripts/edgy b/scripts/edgy | |
index 719a258..d3b1ca1 100644 | |
--- a/scripts/edgy | |
+++ b/scripts/edgy | |
@@ -87,8 +87,8 @@ second_stage_install () { | |
baseprog="$(($baseprog + ${1:-1}))" | |
} | |
- if doing_variant fakechroot; then | |
- setup_proc_fakechroot | |
+ if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then | |
+ setup_proc_symlink | |
else | |
setup_proc | |
in_target /sbin/ldconfig | |
diff --git a/scripts/feisty b/scripts/feisty | |
index e38f799..f3b4031 100644 | |
--- a/scripts/feisty | |
+++ b/scripts/feisty | |
@@ -86,8 +86,8 @@ second_stage_install () { | |
baseprog="$(($baseprog + ${1:-1}))" | |
} | |
- if doing_variant fakechroot; then | |
- setup_proc_fakechroot | |
+ if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then | |
+ setup_proc_symlink | |
else | |
setup_proc | |
in_target /sbin/ldconfig | |
diff --git a/scripts/gutsy b/scripts/gutsy | |
index c3ae032..c3e44fc 100644 | |
--- a/scripts/gutsy | |
+++ b/scripts/gutsy | |
@@ -122,8 +122,8 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" | |
baseprog="$(($baseprog + ${1:-1}))" | |
} | |
- if doing_variant fakechroot; then | |
- setup_proc_fakechroot | |
+ if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then | |
+ setup_proc_symlink | |
else | |
setup_proc | |
in_target /sbin/ldconfig | |
diff --git a/scripts/sarge.fakechroot b/scripts/sarge.fakechroot | |
index df3ae1b..c2e8566 100644 | |
--- a/scripts/sarge.fakechroot | |
+++ b/scripts/sarge.fakechroot | |
@@ -101,7 +101,7 @@ second_stage_install () { | |
} | |
setup_devices_fakechroot | |
- setup_proc_fakechroot | |
+ setup_proc_symlink | |
DEBIAN_FRONTEND=noninteractive | |
export DEBIAN_FRONTEND | |
-- | |
2.18.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment