From 0ab5cffbef989d01aa1c2702821d65e3048d0971 Mon Sep 17 00:00:00 2001 From: thorstenspille Date: Sun, 21 Jan 2024 13:47:07 +0100 Subject: [PATCH] Add docker service --- src/docker/constants-service.conf | 29 +++++++++++++++++++++++++++++ src/docker/install-service.sh | 16 ++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/docker/constants-service.conf create mode 100644 src/docker/install-service.sh diff --git a/src/docker/constants-service.conf b/src/docker/constants-service.conf new file mode 100644 index 0000000..32cc867 --- /dev/null +++ b/src/docker/constants-service.conf @@ -0,0 +1,29 @@ +#!/bin/bash + +# Authors: +# (C) 2021 Idea an concept by Christian Zengel +# (C) 2021 Script design and prototype by Markus Helmke +# (C) 2021 Script rework and documentation by Thorsten Spille + +# This file contains the project constants on service level + +# Debian Version, which will be installed +LXC_TEMPLATE_VERSION="debian-12-standard" + +# Create sharefs mountpoint +LXC_MP="0" + +# Create unprivileged container +LXC_UNPRIVILEGED="1" + +# enable nesting feature +LXC_NESTING="1" + +# enable keyctl feature +LXC_KEYCTL="1" + +# Sets the minimum amount of RAM the service needs for operation +LXC_MEM_MIN=2048 + +# service dependent meta tags +SERVICE_TAGS="" \ No newline at end of file diff --git a/src/docker/install-service.sh b/src/docker/install-service.sh new file mode 100644 index 0000000..aa63ac9 --- /dev/null +++ b/src/docker/install-service.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Authors: +# (C) 2021 Idea an concept by Christian Zengel +# (C) 2021 Script design and prototype by Markus Helmke +# (C) 2021 Script rework and documentation by Thorsten Spille + +# Add Docker's official GPG key: +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +chmod a+r /etc/apt/keyrings/docker.gpg + +# Add the repository to Apt sources: +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null +apt-get update +DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \ No newline at end of file