Commit 7b1e709f authored by Seblu's avatar Seblu
Browse files

docker: Various fixes

- Use /usr/lib/docker for dockerinit
- Don't strip package (which broke everything)
- Add make-rprivate like in the upstream systemd service file
parent a67f703e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
diff --git a/utils/utils.go b/utils/utils.go
index cfdc73b..becc0dd 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -279,9 +279,14 @@ func DockerInitPath(localCopy string) string {
 	var possibleInits = []string{
 		localCopy,
 		filepath.Join(filepath.Dir(selfPath), "dockerinit"),
+
 		// "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
 		"/usr/libexec/docker/dockerinit",
 		"/usr/local/libexec/docker/dockerinit",
+
+		// strict FHS 2.3: "/usr/lib includes object files, libraries, and internal binaries that are not intended to be executed directly by users or shell scripts."
+		"/usr/lib/docker/dockerinit",
+		"/usr/local/lib/docker/dockerinit",
 	}
 	for _, dockerInit := range possibleInits {
 		path, err := exec.LookPath(dockerInit)
 No newline at end of file
+15 −3
Original line number Diff line number Diff line
@@ -11,16 +11,22 @@ url='http://www.docker.io/'
license=('Apache')
depends=('bridge-utils' 'iproute2' 'device-mapper' 'lxc' 'sqlite' 'systemd')
makdepends=('git' 'go')
# don't strip binaries! A sha1 is used to check binary consistency.
options=('!strip')
source=("git+https://github.com/dotcloud/docker.git#tag=v$pkgver"
        'docker.service')
        'docker.service'
        '01-fix-libexec.patch')
md5sums=('SKIP'
         'bba5868c45f45e4ae0dc9175e9e3017e')
         '3f7ccab915fb1942f06e18946c2811d2'
         '6684c04dd4697e0cb7aa3f171c96a2e4')
# magic harcoded path
_magic=src/github.com/dotcloud

prepare() {
  mkdir -p "$_magic"
  ln -sfn "../../../docker" "$_magic/docker"
  # patch for libexec path waiting 0.7.1
  patch -p1 -d docker < 01-fix-libexec.patch
}

build() {
@@ -29,10 +35,16 @@ build() {
  ./hack/make.sh dynbinary
}

check() {
  cd "$_magic/docker"
  # Will be added upstream soon
  #./hack/make.sh dyntest
}

package() {
  cd "$_magic/docker"
  install -Dm755 "bundles/$pkgver/dynbinary/docker-$pkgver" "$pkgdir/usr/bin/docker"
  install -Dm755 "bundles/$pkgver/dynbinary/dockerinit-$pkgver" "$pkgdir/usr/libexec/docker/dockerinit"
  install -Dm755 "bundles/$pkgver/dynbinary/dockerinit-$pkgver" "$pkgdir/usr/lib/docker/dockerinit"
  # completion
  install -Dm644 "contrib/completion/bash/docker" "$pkgdir/usr/share/bash-completion/completions/docker"
  install -Dm644 "contrib/completion/zsh/_docker" "$pkgdir/usr/share/zsh/site-functions/_docker"
+3 −1
Original line number Diff line number Diff line
[Unit]
Description=Docker Daemon
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
After=network.target

[Service]
ExecStartPre=/usr/bin/mount --make-rprivate /
ExecStart=/usr/bin/docker -d

[Install]