Docker config/preinstall/postinstall steps

This commit is contained in:
Starbeamrainbowlabs 2021-11-26 00:49:09 +00:00
parent b624232e27
commit aa96b66372
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 32 additions and 0 deletions

14
src/steps-config/20-docker.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
task_begin "Configuring Docker apt repository";
# curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
# chmod +x /tmp/get-docker.sh
# sudo sh /tmp/get-docker.sh
echo "deb [arch=$(dpkg --print-architecture)] http://download.docker.com/linux/raspbian buster stable" >/etc/apt/sources.list.d/docker.list;
queue_apt_install docker-ce;
task_end "$?";
queue_preinstall_step "20-docker.sh";
queue_postinstall_step "20-docker.sh";

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [[ ! -e "/etc/docker/daemon.json" ]]; then
task_begin "Updating Docker configuration";
echo '{"insecure-registries":["registry.service.mooncarrot.space:5000"]}' >/etc/docker/daemon.json;
task_end "$?";
fi
task_begin "Reloading docker systemd service";
systemctl reload docker.service
task_end "$?";

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
task_begin "docker: installing libseccomp2 from ${VERSION_CODENAME}-backports";
# Fix apt update errors inside docker containers
# Ref https://blog.samcater.com/fix-workaround-rpi4-docker-libseccomp2-docker-20/
apt-get install libseccomp2 -t "${VERSION_CODENAME}-backports"
task_end "$?";