0

Initial commit

This commit is contained in:
eleksir
2023-11-19 18:01:40 +03:00
commit 80ec8a7529
586 changed files with 29486 additions and 0 deletions

35
docker/README Normal file
View File

@@ -0,0 +1,35 @@
Docker is an open-source project to easily create lightweight, portable,
self-sufficient containers from any application. The same container
that a developer builds and tests on a laptop can run at scale, in
production, on VMs, bare metal, OpenStack clusters, public clouds and
more.
To use docker as a limited user, add your user to the 'docker' group:
# groupadd -r -g 281 docker
# usermod -a -G docker <your_username>
This will require logging out and back in and also restarting docker
daemon.
To have the docker daemon start and stop with your host,
add to /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.docker ]; then
/etc/rc.d/rc.docker start
fi
and to /etc/rc.d/rc.local_shutdown (creating it if needed):
if [ -x /etc/rc.d/rc.docker ]; then
/etc/rc.d/rc.docker stop
fi
If you are interested in enabling cgroup memory resource control over
swap as well, then append "swapaccount=1" to your kernel's parameters.
This is often in /etc/lilo.conf, on the "append" variable.
NOTE: google-go-lang is only needed at compile time - not needed for
runtime.
Docker doesn't support x86, only x86_64.

View File

@@ -0,0 +1,3 @@
## Set defaults used by the docker daemon.
## These are flags passed after `dockerd`.
#DOCKER_OPTS=""

View File

@@ -0,0 +1,9 @@
/var/log/docker.log {
daily
rotate 7
copytruncate
delaycompress
compress
notifempty
missingok
}

86
docker/config/rc.docker Normal file
View File

@@ -0,0 +1,86 @@
#!/bin/sh
#
# Docker startup script for Slackware Linux
#
# Docker is an open-source project to easily create lightweight, portable,
# self-sufficient containers from any application.
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
BASE=dockerd
UNSHARE=/usr/bin/unshare
DOCKER=/usr/bin/${BASE}
DOCKER_PIDFILE=/var/run/${BASE}.pid
DOCKER_LOG=/var/log/docker.log
DOCKER_OPTS=""
# Default options.
if [ -f /etc/default/docker ]; then
. /etc/default/docker
fi
# Check if docker is present.
if [ ! -x ${DOCKER} ]; then
echo "${DOCKER} not present or not executable"
exit 1
fi
docker_start() {
echo "Starting ${BASE} ..."
# If there is an old PID file (no dockerd running), clean it up.
if [ -r ${DOCKER_PIDFILE} ]; then
if ! ps axc | grep ${BASE} 1> /dev/null 2> /dev/null ; then
echo "Cleaning up old ${DOCKER_PIDFILE}."
rm -f ${DOCKER_PIDFILE}
fi
fi
nohup "${UNSHARE}" -m -- ${DOCKER} -p ${DOCKER_PIDFILE} ${DOCKER_OPTS} >> ${DOCKER_LOG} 2>&1 &
}
docker_stop() {
echo -n "Stopping ${BASE} ..."
if [ -r ${DOCKER_PIDFILE} ]; then
DOCKER_PID=$(cat ${DOCKER_PIDFILE})
kill ${DOCKER_PID}
while [ -d /proc/${DOCKER_PID} ]; do
sleep 1
echo -n "."
done
fi
echo " done"
}
docker_restart() {
docker_stop
sleep 1
docker_start
}
docker_status() {
if [ -f ${DOCKER_PIDFILE} ] && ps -o cmd $(cat ${DOCKER_PIDFILE}) | grep -q ${BASE} ; then
echo "Status of ${BASE}: running"
else
echo "Status of ${BASE}: stopped"
fi
}
case "$1" in
'start')
docker_start
;;
'stop')
docker_stop
;;
'restart')
docker_restart
;;
'status')
docker_status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
esac
exit 0

109
docker/docker.SlackBuild Executable file
View File

@@ -0,0 +1,109 @@
#!/bin/sh
# Slackware build script for docker
# Copyright 2014-2015 Vincent Batts <vbatts@hashbangbash.com>
# Copyright 2017-2021 Audrius Kažukauskas <audrius@neutrino.lt>
# Copyright 2023 Sergei Fedosoff <eleksir@gmail.com>
#
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=docker
VERSION=${VERSION:-24.0.7}
# short hash!
GITHASH=${GITHASH:-311b9ff}
BUILD=${BUILD:-1}
TAG=${TAG:-_EXs}
SRCNAM=moby
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/EXs}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION
tar xf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
mkdir build
mv vendor build/src
ln -sf $TMP/$SRCNAM-$VERSION build/src/github.com/docker/docker
export GOPATH="${GOPATH}:$TMP/$SRCNAM-$VERSION/build"
export GOMODCACHE=/tmp/go
export LDFLAGS="-s -w"
/bin/bash ./hack/vendor.sh all
DOCKER_GITCOMMIT=$GITHASH \
DOCKER_BUILDTAGS="seccomp" \
VERSION=$VERSION \
/bin/bash ./hack/make.sh dynbinary-daemon
install -D -m 0755 bundles/dynbinary-daemon/dockerd \
$PKG/usr/bin/dockerd
# Integrate required components.
ln -s runc $PKG/usr/bin/docker-runc
ln -s containerd $PKG/usr/bin/docker-containerd
ln -s containerd-shim $PKG/usr/bin/docker-containerd-shim
ln -s ctr $PKG/usr/bin/docker-containerd-ctr
ln -s tini-static $PKG/usr/bin/docker-init
install -D -m 0644 $CWD/config/docker.default $PKG/etc/default/docker.new
install -D -m 0644 $CWD/config/docker.logrotate $PKG/etc/logrotate.d/docker.new
install -D -m 0644 $CWD/config/rc.docker $PKG/etc/rc.d/rc.docker.new
# Install udev rules.
install -D -m 0644 contrib/udev/80-docker.rules \
$PKG/lib/udev/rules.d/80-docker.rules
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE NOTICE README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-required > $PKG/install/slack-required
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

11
docker/docker.info Normal file
View File

@@ -0,0 +1,11 @@
PRGNAM="docker"
VERSION="24.0.7"
HOMEPAGE="https://www.docker.com/products/container-runtime"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="https://github.com/moby/moby/archive/v24.0.7/moby-24.0.7.tar.gz"
MD5SUM_x86_64="059ed51462797354f39e630d3d2257ef"
REQUIRES="containerd docker-cli tini"
BUILDREQUIRES="google-go-lang"
MAINTAINER="Sergei Fedosoff"
EMAIL="eleksir@gmail.com"

32
docker/doinst.sh Normal file
View File

@@ -0,0 +1,32 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.docker.new
config etc/default/docker.new
config etc/logrotate.d/docker.new
if [ -x /sbin/udevadm ]; then
/sbin/udevadm control --reload-rules
fi

19
docker/slack-desc Normal file
View File

@@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
docker: docker (manager for applications in Linux containers)
docker:
docker: Docker is an open-source project to easily create lightweight,
docker: portable, self-sufficient containers from any application. The same
docker: container that a developer builds and tests on a laptop can run at
docker: scale, in production, on VMs, bare metal, OpenStack clusters, public
docker: clouds and more.
docker:
docker: Homepage: https://www.docker.com/products/container-runtime
docker:
docker:

3
docker/slack-required Normal file
View File

@@ -0,0 +1,3 @@
containerd
docker-cli
tini