2018-10-22 23:38:52 +02:00
|
|
|
# install
|
2018-10-22 23:53:55 +02:00
|
|
|
yum install lxc lxc-templates debootstrap libvirt
|
2018-10-22 23:38:52 +02:00
|
|
|
|
|
|
|
# create container
|
|
|
|
lxc-create -t download -n piston
|
|
|
|
select ubuntu, bionic, amd64
|
|
|
|
|
|
|
|
# start container
|
|
|
|
lxc-start -n piston -d
|
|
|
|
|
|
|
|
# shell in and install stuff
|
|
|
|
lxc-attach -n piston
|
|
|
|
export PATH=/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
|
|
|
|
sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu/http:\/\/mirror.math.princeton.edu\/pub\/ubuntu/' /etc/apt/sources.list
|
|
|
|
apt-get update
|
2018-10-31 04:51:00 +01:00
|
|
|
apt-get -y install git tzdata nano dpkg-dev build-essential python python3 ruby nodejs golang php7.2 r-base mono-complete nasm openjdk-8-jdk
|
2018-11-02 06:21:22 +01:00
|
|
|
apt-get -y install ubuntu-make
|
2018-10-31 04:51:00 +01:00
|
|
|
umake swift
|
2018-11-02 06:21:22 +01:00
|
|
|
set dir to /opt/swift/swift-lang
|
|
|
|
ln -s /opt/swift/swift-lang/usr/bin/swift /usr/bin/swift
|
2018-10-31 04:51:00 +01:00
|
|
|
|
2018-10-22 23:38:52 +02:00
|
|
|
|
2018-10-24 07:34:33 +02:00
|
|
|
# create users and apply limits
|
|
|
|
for i in {1..150}; do
|
|
|
|
#userdel runner$i
|
|
|
|
useradd -M runner$i
|
|
|
|
usermod -d /tmp runner$i
|
|
|
|
echo "runner$i soft nproc 64" >> /etc/security/limits.conf
|
|
|
|
echo "runner$i hard nproc 64" >> /etc/security/limits.conf
|
|
|
|
echo "runner$i soft nofile 2048" >> /etc/security/limits.conf
|
|
|
|
echo "runner$i hard nofile 2048" >> /etc/security/limits.conf
|
|
|
|
done
|
2018-10-23 02:14:17 +02:00
|
|
|
|
|
|
|
# remove home dir
|
|
|
|
rm -rf /home/ubuntu
|
|
|
|
|
|
|
|
# set tmp
|
|
|
|
chmod 755 /tmp
|