Add docker-image in order to launch a base system capable of running docker daemon
This commit is contained in:
parent
63182b910a
commit
f655d5f14b
@ -1,6 +1,7 @@
|
|||||||
Common targets are:
|
Common targets are:
|
||||||
console-image
|
console-image
|
||||||
console-dev-image
|
console-dev-image
|
||||||
|
tiny-image
|
||||||
core-image-minimal
|
core-image-minimal
|
||||||
core-image-sato
|
core-image-sato
|
||||||
meta-toolchain
|
meta-toolchain
|
||||||
|
@ -4,7 +4,7 @@ MACHINE ?= "bananapi-m3"
|
|||||||
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
|
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
|
||||||
#TMPDIR = "${TOPDIR}/tmp"
|
#TMPDIR = "${TOPDIR}/tmp"
|
||||||
|
|
||||||
DISTRO ?= "poky"
|
DISTRO ?= "roro"
|
||||||
PACKAGE_CLASSES ?= "package_ipk"
|
PACKAGE_CLASSES ?= "package_ipk"
|
||||||
|
|
||||||
#SDKMACHINE ?= "i686"
|
#SDKMACHINE ?= "i686"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
|
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
|
||||||
# changes incompatibly
|
# changes incompatibly
|
||||||
POKY_BBLAYERS_CONF_VERSION = "2"
|
POKY_BBLAYERS_CONF_VERSION = "3"
|
||||||
|
|
||||||
BBPATH = "${TOPDIR}"
|
BBPATH = "${TOPDIR}"
|
||||||
BBFILES ?= ""
|
BBFILES ?= ""
|
||||||
@ -9,8 +9,11 @@ BBLAYERS ?= " \
|
|||||||
${TOPDIR}/../layers/poky/meta \
|
${TOPDIR}/../layers/poky/meta \
|
||||||
${TOPDIR}/../layers/poky/meta-poky \
|
${TOPDIR}/../layers/poky/meta-poky \
|
||||||
${TOPDIR}/../layers/poky/meta-yocto-bsp \
|
${TOPDIR}/../layers/poky/meta-yocto-bsp \
|
||||||
|
${TOPDIR}/../layers/meta-openembedded/meta-filesystems \
|
||||||
${TOPDIR}/../layers/meta-openembedded/meta-oe \
|
${TOPDIR}/../layers/meta-openembedded/meta-oe \
|
||||||
${TOPDIR}/../layers/meta-openembedded/meta-networking \
|
${TOPDIR}/../layers/meta-openembedded/meta-networking \
|
||||||
${TOPDIR}/../layers/meta-openembedded/meta-python \
|
${TOPDIR}/../layers/meta-openembedded/meta-python \
|
||||||
|
${TOPDIR}/../layers/meta-virtualization \
|
||||||
${TOPDIR}/../layers/meta-blackfinn \
|
${TOPDIR}/../layers/meta-blackfinn \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
Common targets are:
|
Common targets are:
|
||||||
console-image
|
console-image
|
||||||
console-dev-image
|
console-dev-image
|
||||||
|
docker-image
|
||||||
|
tiny-image
|
||||||
core-image-minimal
|
core-image-minimal
|
||||||
core-image-sato
|
core-image-sato
|
||||||
meta-toolchain
|
meta-toolchain
|
||||||
|
@ -4,7 +4,7 @@ MACHINE ?= "beaglebone-yocto"
|
|||||||
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
|
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
|
||||||
#TMPDIR = "${TOPDIR}/tmp"
|
#TMPDIR = "${TOPDIR}/tmp"
|
||||||
|
|
||||||
DISTRO ?= "poky"
|
DISTRO ?= "roro"
|
||||||
PACKAGE_CLASSES ?= "package_ipk"
|
PACKAGE_CLASSES ?= "package_ipk"
|
||||||
|
|
||||||
#SDKMACHINE ?= "i686"
|
#SDKMACHINE ?= "i686"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
Common targets are:
|
Common targets are:
|
||||||
console-image
|
console-image
|
||||||
console-dev-image
|
console-dev-image
|
||||||
|
tiny-image
|
||||||
core-image-minimal
|
core-image-minimal
|
||||||
core-image-sato
|
core-image-sato
|
||||||
meta-toolchain
|
meta-toolchain
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MACHINE ?= "raspberrypi3-64"
|
MACHINE ?= "raspberrypi3-64"
|
||||||
|
|
||||||
DISTRO ?= "poky"
|
DISTRO ?= "roro"
|
||||||
PACKAGE_CLASSES ?= "package_ipk"
|
PACKAGE_CLASSES ?= "package_ipk"
|
||||||
|
|
||||||
#SDKMACHINE ?= "i686"
|
#SDKMACHINE ?= "i686"
|
||||||
|
18
conf/distro/roro.conf
Normal file
18
conf/distro/roro.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
require conf/distro/poky.conf
|
||||||
|
# distro name
|
||||||
|
DISTRO = "roro"
|
||||||
|
DISTRO_NAME = "roro distribution"
|
||||||
|
DISTRO_VERSION = "1.0"
|
||||||
|
DISTRO_CODENAME = "roro"
|
||||||
|
#DISTRO_FEATURES_append = " alsa usbhost usbgadget keyboard bluetooth"
|
||||||
|
|
||||||
|
POKY_DEFAULT_DISTRO_FEATURES = "largefile"
|
||||||
|
POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
|
||||||
|
POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
|
||||||
|
DISTRO_FEATURES_DEFAULT = "ipv4 ipv6 largefile usbhost wifi zeroconf virtualization"
|
||||||
|
|
||||||
|
SDK_VENDOR = "-rorodistsdk"
|
||||||
|
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
||||||
|
MAINTAINER = "rorodist "
|
||||||
|
INHERIT += "buildhistory"
|
||||||
|
BUILDHISTORY_COMMIT = "1"
|
@ -1,15 +0,0 @@
|
|||||||
require conf/distro/poky.conf
|
|
||||||
# distro name
|
|
||||||
DISTRO = "tkl"
|
|
||||||
DISTRO_NAME = "tkl distribution"
|
|
||||||
DISTRO_VERSION = "1.0"
|
|
||||||
DISTRO_CODENAME = "tkl"
|
|
||||||
#DISTRO_FEATURES_append = " alsa usbhost usbgadget keyboard bluetooth"
|
|
||||||
|
|
||||||
PREFERRED_VERSION_mypy = "0.4.2"
|
|
||||||
|
|
||||||
SDK_VENDOR = "-tkldistsdk"
|
|
||||||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
|
||||||
MAINTAINER = "tkldist "
|
|
||||||
INHERIT += "buildhistory"
|
|
||||||
BUILDHISTORY_COMMIT = "1"
|
|
7
recipes-containers/docker/docker-ce_git.bbappend
Normal file
7
recipes-containers/docker/docker-ce_git.bbappend
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
LICENSE = "GPLv2"
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||||
|
|
||||||
|
SRC_URI += " \
|
||||||
|
file://docker.init \
|
||||||
|
"
|
||||||
|
|
131
recipes-containers/docker/files/docker.init
Normal file
131
recipes-containers/docker/files/docker.init
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# /etc/rc.d/init.d/docker
|
||||||
|
#
|
||||||
|
# Daemon for docker.com
|
||||||
|
#
|
||||||
|
# chkconfig: 2345 95 95
|
||||||
|
# description: Daemon for docker.com
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: docker
|
||||||
|
# Required-Start: $network cgconfig
|
||||||
|
# Required-Stop:
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: start and stop docker
|
||||||
|
# Description: Daemon for docker.com
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
prog="dockerd"
|
||||||
|
unshare=/usr/bin/unshare
|
||||||
|
exec="/usr/bin/$prog"
|
||||||
|
pidfile="/var/run/$prog.pid"
|
||||||
|
lockfile="/var/lock/subsys/$prog"
|
||||||
|
logfile="/var/log/$prog"
|
||||||
|
other_args="--pidfile $pidfile --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
|
||||||
|
|
||||||
|
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
||||||
|
|
||||||
|
start() {
|
||||||
|
[ -x $exec ] || exit 5
|
||||||
|
|
||||||
|
check_for_cleanup
|
||||||
|
|
||||||
|
if ! [ -f $pidfile ]; then
|
||||||
|
printf "Starting $prog:\t"
|
||||||
|
echo -e "\n$(date)\n" >> $logfile
|
||||||
|
"$unshare" -m -- $exec $other_args & >> $logfile &
|
||||||
|
pid=$!
|
||||||
|
touch $lockfile
|
||||||
|
# wait up to 10 seconds for the pidfile to exist. see
|
||||||
|
# https://github.com/docker/docker/issues/5359
|
||||||
|
tries=0
|
||||||
|
while [ ! -f $pidfile -a $tries -lt 10 ]; do
|
||||||
|
sleep 1
|
||||||
|
tries=$((tries + 1))
|
||||||
|
done
|
||||||
|
success
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
failure
|
||||||
|
echo
|
||||||
|
printf "$pidfile still exists...\n"
|
||||||
|
exit 7
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping $prog: "
|
||||||
|
killproc $prog
|
||||||
|
retval=$?
|
||||||
|
echo
|
||||||
|
[ $retval -eq 0 ] && rm -f $lockfile
|
||||||
|
return $retval
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
restart
|
||||||
|
}
|
||||||
|
|
||||||
|
force_reload() {
|
||||||
|
restart
|
||||||
|
}
|
||||||
|
|
||||||
|
rh_status() {
|
||||||
|
status $prog
|
||||||
|
}
|
||||||
|
|
||||||
|
rh_status_q() {
|
||||||
|
rh_status >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
check_for_cleanup() {
|
||||||
|
if [ -f ${pidfile} ]; then
|
||||||
|
/bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
rh_status_q && exit 0
|
||||||
|
$1
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
rh_status_q || exit 0
|
||||||
|
$1
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$1
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
rh_status_q || exit 7
|
||||||
|
$1
|
||||||
|
;;
|
||||||
|
force-reload)
|
||||||
|
force_reload
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
rh_status
|
||||||
|
;;
|
||||||
|
condrestart|try-restart)
|
||||||
|
rh_status_q || exit 0
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
||||||
|
exit 2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
10
recipes-core/images/docker-image.bb
Normal file
10
recipes-core/images/docker-image.bb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SUMMARY = "A tiny image"
|
||||||
|
HOMEPAGE = "https://blackfinn.de"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
require tiny-image-base.inc
|
||||||
|
|
||||||
|
IMAGE_INSTALL_append = " docker"
|
||||||
|
|
||||||
|
export IMAGE_BASENAME = "tiny-image"
|
||||||
|
|
48
recipes-core/images/tiny-image-base.inc
Normal file
48
recipes-core/images/tiny-image-base.inc
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
inherit core-image
|
||||||
|
|
||||||
|
require users.inc
|
||||||
|
|
||||||
|
IMAGE_FEATURES += "package-management"
|
||||||
|
|
||||||
|
CORE_OS = " \
|
||||||
|
openssh \
|
||||||
|
openssh-keygen \
|
||||||
|
openssh-sftp-server \
|
||||||
|
psplash \
|
||||||
|
tzdata \
|
||||||
|
"
|
||||||
|
|
||||||
|
KERNEL_EXTRA_INSTALL = " \
|
||||||
|
kernel-modules \
|
||||||
|
"
|
||||||
|
|
||||||
|
WIFI_SUPPORT = " \
|
||||||
|
wpa-supplicant \
|
||||||
|
"
|
||||||
|
|
||||||
|
EXTRA_TOOLS_INSTALL = " \
|
||||||
|
"
|
||||||
|
|
||||||
|
IMAGE_INSTALL += " \
|
||||||
|
${CORE_OS} \
|
||||||
|
${EXTRA_TOOLS_INSTALL} \
|
||||||
|
${KERNEL_EXTRA_INSTALL} \
|
||||||
|
${WIFI_SUPPORT} \
|
||||||
|
"
|
||||||
|
|
||||||
|
IMAGE_INSTALL_append_beaglebone-yocto = " linux-firmware-rtl8192cu"
|
||||||
|
IMAGE_INSTALL_append_bananapi-m3 += " linux-firmware-bcm43430"
|
||||||
|
|
||||||
|
set_local_timezone() {
|
||||||
|
ln -sf /usr/share/zoneinfo/Europe/Berlin ${IMAGE_ROOTFS}/etc/localtime
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_bootlogd() {
|
||||||
|
echo BOOTLOGD_ENABLE=no > ${IMAGE_ROOTFS}/etc/default/bootlogd
|
||||||
|
}
|
||||||
|
|
||||||
|
ROOTFS_POSTPROCESS_COMMAND += " \
|
||||||
|
set_local_timezone ; \
|
||||||
|
disable_bootlogd ; \
|
||||||
|
"
|
||||||
|
|
8
recipes-core/images/tiny-image.bb
Normal file
8
recipes-core/images/tiny-image.bb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
SUMMARY = "A tiny image"
|
||||||
|
HOMEPAGE = "https://blackfinn.de"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
require tiny-image-base.inc
|
||||||
|
|
||||||
|
export IMAGE_BASENAME = "tiny-image"
|
||||||
|
|
8
recipes-core/images/users.inc
Normal file
8
recipes-core/images/users.inc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
inherit extrausers
|
||||||
|
|
||||||
|
# Encrypt the password with: echo "<password>" | openssl passwd -1 -stdin
|
||||||
|
EXTRA_USERS_PARAMS = " \
|
||||||
|
usermod -p '\$1\$4h5Qdc3i\$Vke4J2Ci5z.D3TtFDmV9r/' root; \
|
||||||
|
useradd -p '\$1\$4h5Qdc3i\$Vke4J2Ci5z.D3TtFDmV9r/' tkl; \
|
||||||
|
"
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
CONFIG_DEBUG_BLK_CGROUP=y
|
||||||
|
CONFIG_CFS_BANDWIDTH=y
|
||||||
|
CONFIG_CGROUP_RDMA=y
|
||||||
|
|
@ -14,5 +14,6 @@ KERNEL_CONFIG_FRAGMENTS_append_ti33x = " \
|
|||||||
${WORKDIR}/rtl8192cu.cfg \
|
${WORKDIR}/rtl8192cu.cfg \
|
||||||
${WORKDIR}/enable_onboard_leds.cfg \
|
${WORKDIR}/enable_onboard_leds.cfg \
|
||||||
${WORKDIR}/enable_hostap_wext.cfg \
|
${WORKDIR}/enable_hostap_wext.cfg \
|
||||||
|
${WORKDIR}/enable_cgroups.cfg \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user