Docker on Slackware with GO

by jbthechamp83
1 deployments · 0 still active · last rev. 1 year ago

Docker install using slackware with golang included of course. enjoy

Compatible with: Slackware 13.37 32bit
						#!/bin/bash
#
# StackScript Bash Library
#
# Copyright (c) 2015 Jurisdesk LLC / James Barlow <james@jurisdesk.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# * Neither the name of Jurisdesk LLC nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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.
#
# Installs a complete Slackware ready Docker instance with golang installed
#
# Copyright (c) 2015 James Barlow <james@dockerd.io>.
#
# My ref: https://www.linode.com/?r=6bc13d37a6384afa18b7ba182e355e40a12e10c0

echo "BATCH=on" >> /etc/slackpkg/slackpkg.conf
echo "DEFAULT_ANSWER=y" >> /etc/slackpkg/slackpkg.conf
echo "kdei" >> /etc/slackpkg/blacklist


cat << EOF > /etc/hosts
127.0.0.1 localhost localhost.localdomain
EOF

slackpkg update
slackpkg upgrade-all
slackpkg update
slackpkg install rsync
slackpkg install sasl
slackpkg install gcc
slackpkg install autoconf
slackpkg install automake
slackpkg install autoconf
slackpkg install libmpc
slackpkg install kernel-headers
slackpkg install sqlite
slackpkg install libcgroup

mkdir -p /var/lib/sbopkg/SBo/14.1
mkdir -p /var/lib/sbopkg/queues
mkdir -p /var/cache/sbopkg
mkdir -p /tmp/SBo
mkdir -p /var/log/sbopkg

wget http://sbopkg.googlecode.com/files/sbopkg-0.37.0-noarch-1_cng.tgz
installpkg *.t?z
rm *.t?z

sbopkg -r

sbopkg -B -i google-go-lang

#docker stuff
groupadd -r -g 281 docker
cat << EOF >> /etc/fstab
cgroup /cgroup/cpuset cgroup rw,relatime,cpuset 0 0
cgroup /cgroup/cpu cgroup rw,relatime,cpu 0 0
cgroup /cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0
cgroup /cgroup/memory cgroup rw,relatime,memory 0 0
cgroup /cgroup/devices cgroup rw,relatime,devices 0 0
cgroup /cgroup/freezer cgroup rw,relatime,freezer 0 0
cgroup /cgroup/net_cls cgroup rw,relatime,net_cls 0 0
cgroup /cgroup/blkio cgroup rw,relatime,blkio 0 0
EOF
cat << EOF >> /etc/rc.d/rc.local
if [ -x /etc/rc.d/rc.docker ]; then
    /etc/rc.d/rc.docker start
fi
EOF
cat << EOF >> /etc/rc.d/rc.local_shutdown
if [ -x /etc/rc.d/rc.docker ]; then
    /etc/rc.d/rc.docker stop
fi
EOF
chmod +x /etc/rc.d/rc.local_shutdown
sbopkg -B -i docker