Merge pull request #209 from lrusak/docker

docker: fix build for 1.11.0
This commit is contained in:
Christian Hewitt 2016-04-22 12:55:02 +04:00
commit e4a62a180b
5 changed files with 174 additions and 5 deletions

View File

@ -0,0 +1,77 @@
################################################################################
# This file is part of LibreELEC - http://www.libreelec.tv
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="containerd"
PKG_VERSION="d2f0386"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="APL"
PKG_SITE="https://containerd.tools/"
PKG_URL="https://github.com/docker/containerd/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="toolchain go"
PKG_PRIORITY="optional"
PKG_SECTION="system"
PKG_SHORTDESC="containerd is a daemon to control runC"
PKG_LONGDESC="containerd is a daemon to control runC, built for performance and density. containerd leverages runC's advanced features such as seccomp and user namespace support as well as checkpoint and restore for cloning and live migration of containers."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
pre_make_target() {
case $TARGET_ARCH in
x86_64)
export GOARCH=amd64
;;
arm)
export GOARCH=arm
case $TARGET_CPU in
arm1176jzf-s)
export GOARM=6
;;
cortex-a7)
export GOARM=7
;;
esac
;;
esac
export GOOS=linux
export CGO_ENABLED=1
export CGO_NO_EMULATION=1
export CGO_CFLAGS=$CFLAGS
export LDFLAGS="-w -extldflags -static -X github.com/docker/containerd.GitCommit=${PKG_VERSION} -extld $TARGET_CC"
export GOLANG=$ROOT/$TOOLCHAIN/lib/golang/bin/go
export GOPATH=$ROOT/$PKG_BUILD.gopath:$ROOT/$PKG_BUILD/vendor/
export GOROOT=$ROOT/$TOOLCHAIN/lib/golang
export PATH=$PATH:$GOROOT/bin
ln -fs $ROOT/$PKG_BUILD $ROOT/$PKG_BUILD/vendor/src/github.com/docker/containerd
}
make_target() {
mkdir -p bin
$GOLANG build -v -o bin/ctr -a -tags "static_build" -ldflags "$LDFLAGS" ./ctr
$GOLANG build -v -o bin/containerd -a -tags "static_build" -ldflags "$LDFLAGS" ./containerd
$GOLANG build -v -o bin/containerd-shim -a -tags "static_build" -ldflags "$LDFLAGS" ./containerd-shim
}
makeinstall_target() {
:
}

View File

@ -0,0 +1,11 @@
diff -Naur a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
--- a/src/crypto/x509/root_unix.go 2016-04-19 16:27:35.000000000 -0700
+++ b/src/crypto/x509/root_unix.go 2016-04-22 01:21:02.884977461 -0700
@@ -13,6 +13,7 @@
var certDirectories = []string{
"/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
"/system/etc/security/cacerts", // Android
+ "/etc/ssl", // LibreELEC
}
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {

View File

@ -0,0 +1,74 @@
################################################################################
# This file is part of LibreELEC - http://www.libreelec.tv
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="runc"
PKG_VERSION="e874369"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="APL"
PKG_SITE="https://github.com/opencontainers/runc"
PKG_URL="https://github.com/opencontainers/runc/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="toolchain go"
PKG_PRIORITY="optional"
PKG_SECTION="system"
PKG_SHORTDESC="runc is a CLI tool for spawning and running containers according to the OCI specification"
PKG_LONGDESC="runc is a CLI tool for spawning and running containers according to the OCI specification"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
pre_make_target() {
case $TARGET_ARCH in
x86_64)
export GOARCH=amd64
;;
arm)
export GOARCH=arm
case $TARGET_CPU in
arm1176jzf-s)
export GOARM=6
;;
cortex-a7)
export GOARM=7
;;
esac
;;
esac
export GOOS=linux
export CGO_ENABLED=1
export CGO_NO_EMULATION=1
export CGO_CFLAGS=$CFLAGS
export LDFLAGS="-w -extldflags -static -X main.gitCommit=${PKG_VERSION} -extld $TARGET_CC"
export GOLANG=$ROOT/$TOOLCHAIN/lib/golang/bin/go
export GOPATH=$ROOT/$PKG_BUILD.gopath:$ROOT/$PKG_BUILD/Godeps/_workspace/
export GOROOT=$ROOT/$TOOLCHAIN/lib/golang
export PATH=$PATH:$GOROOT/bin
ln -fs $ROOT/$PKG_BUILD $ROOT/$PKG_BUILD/Godeps/_workspace/src/github.com/opencontainers/runc
}
make_target() {
mkdir -p bin
$GOLANG build -v -o bin/runc -a -tags "cgo static_build" -ldflags "$LDFLAGS" ./
}
makeinstall_target() {
:
}

View File

@ -24,7 +24,7 @@ PKG_ADDON_PROJECTS="Generic RPi RPi2"
PKG_LICENSE="ASL"
PKG_SITE="http://www.docker.com/"
PKG_URL="https://github.com/docker/docker/archive/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain sqlite go:host"
PKG_DEPENDS_TARGET="toolchain sqlite go:host containerd runc"
PKG_PRIORITY="optional"
PKG_SECTION="service/system"
PKG_SHORTDESC="Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere."
@ -70,8 +70,6 @@ configure_target() {
export GOROOT=$ROOT/$TOOLCHAIN/lib/golang
export PATH=$PATH:$GOROOT/bin
./hack/vendor.sh
ln -fs $ROOT/$PKG_BUILD $ROOT/$PKG_BUILD/vendor/src/github.com/docker/docker
# used for docker version
@ -91,6 +89,14 @@ makeinstall_target() {
}
addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/
cp -a $ROOT/$PKG_BUILD/bin/docker $ADDON_BUILD/$PKG_ADDON_ID/bin/
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -P $ROOT/$PKG_BUILD/bin/docker $ADDON_BUILD/$PKG_ADDON_ID/bin
# containerd
cp -P $(get_build_dir containerd)/bin/containerd $ADDON_BUILD/$PKG_ADDON_ID/bin/docker-containerd
cp -P $(get_build_dir containerd)/bin/containerd-shim $ADDON_BUILD/$PKG_ADDON_ID/bin/docker-containerd-shim
cp -P $(get_build_dir containerd)/bin/ctr $ADDON_BUILD/$PKG_ADDON_ID/bin/docker-containerd-ctr
# runc
cp -P $(get_build_dir runc)/bin/runc $ADDON_BUILD/$PKG_ADDON_ID/bin/docker-runc
}

View File

@ -6,6 +6,7 @@ Requires=docker.socket
[Service]
Type=notify
Environment=PATH=/bin:/sbin:/usr/bin:/usr/sbin:/storage/.kodi/addons/service.system.docker/bin
ExecStartPre=/storage/.kodi/addons/service.system.docker/bin/docker-config
EnvironmentFile=-/storage/.kodi/userdata/addon_data/service.system.docker/config/docker.conf
ExecStart=/storage/.kodi/addons/service.system.docker/bin/docker daemon -H fd:// $DOCKER_DAEMON_OPTS $DOCKER_STORAGE_OPTS