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

47 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2018-02-06 01:36:23 +00:00
# Enable the community repo
2018-02-06 01:45:43 +00:00
edit /etc/apk/repositories:s/^#(.*community.*)$/\1/gmp
update
2018-02-06 01:36:23 +00:00
# Setup the new MOTD
run motd.sh
# Disallow root login
root-password disabled
edit /etc/ssh/sshd_config:'/^PermitRootLogin yes/d'
# Install docker
install docker
run-command rc-update add docker boot
2018-02-06 01:45:43 +00:00
#run-command service docker start
2018-02-06 01:36:23 +00:00
# Install docker-compose
install python
install py-pip
run-command pip install docker-compose
uninstall py-pip
2018-02-06 01:45:43 +00:00
# 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
2018-02-06 01:36:23 +00:00
# Set up pruning docker every 15 minutes. Useful for build agents
run-command rc-update add crond
run-command echo '*/15 * * * * docker system prune -a -f --filter until=10m' | crontab -u docker -
2018-02-06 01:45:43 +00:00
# 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