1
0
mirror of https://github.com/Adam-Ant/DroneAgentBuilder synced 2024-12-20 09:24:35 +00:00

Update builder commands

This commit is contained in:
Adam Dodman 2018-02-06 01:45:43 +00:00
parent b3835c64ea
commit ac98f88837

View File

@ -1,5 +1,6 @@
# Enable the community repo # Enable the community repo
edit /etc/apk/repositories:'s/^#\(.*community\)/\1/g' edit /etc/apk/repositories:s/^#(.*community.*)$/\1/gmp
update
# Setup the new MOTD # Setup the new MOTD
run motd.sh run motd.sh
@ -8,21 +9,11 @@ run motd.sh
root-password disabled root-password disabled
edit /etc/ssh/sshd_config:'/^PermitRootLogin yes/d' edit /etc/ssh/sshd_config:'/^PermitRootLogin yes/d'
# Set up the docker user
update
install docker
install sudo
install shadow
run-command adduser -D -G docker docker
run-command { echo changeme; echo changeme; } | passwd docker
run-command echo changeme | chage -d 0 docker
run-command echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/docker-nopasswd
chmod 0640:/etc/sudoers.d/*
# Install docker # Install docker
install docker install docker
run-command rc-update add docker boot run-command rc-update add docker boot
run-command service docker start #run-command service docker start
# Install docker-compose # Install docker-compose
install python install python
@ -30,8 +21,26 @@ install py-pip
run-command pip install docker-compose run-command pip install docker-compose
uninstall py-pip uninstall py-pip
# Set up the docker user
install sudo
install shadow
run-command adduser -D -G docker docker
run-command { echo changeme; echo changeme; } | passwd docker
run-command passwd -e docker
run-command echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/docker-nopasswd
chmod 0640:/etc/sudoers.d/docker-nopasswd
# Set up pruning docker every 15 minutes. Useful for build agents # Set up pruning docker every 15 minutes. Useful for build agents
run-command rc-update add crond run-command rc-update add crond
run-command echo '*/15 * * * * docker system prune -a -f --filter until=10m' | crontab -u docker - run-command echo '*/15 * * * * docker system prune -a -f --filter until=10m' | crontab -u docker -
# Install the drone-agent starters # Add the start script, docker-compose file, and secrets file
copy-in drone-agent.start:/etc/local.d/
chmod 0755:/etc/local.d/drone-agent.start
run-command rc-update add local default
copy-in drone-compose.yml:/etc/
copy-in dronecfg:/etc/
# Set the hostname
edit /etc/network/interfaces:s/alpine/dronerunner/
run-command echo 'dronerunner' > /etc/hostname