From 0a70f44a6f167279c20ec57de4aae8426d28eebf Mon Sep 17 00:00:00 2001 From: Enno Gotthold Date: Sun, 23 Jun 2024 09:55:57 +0200 Subject: [PATCH] Docker: Initial add of containerization --- docker/develop/Dockerfile | 30 ++++++++++++++++++++++++++++++ docker/develop/entrypoint.sh | 4 ++++ docker/production/Dockerfile | 33 +++++++++++++++++++++++++++++++++ docker/rolling/Dockerfile | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 docker/develop/Dockerfile create mode 100755 docker/develop/entrypoint.sh create mode 100644 docker/production/Dockerfile create mode 100644 docker/rolling/Dockerfile diff --git a/docker/develop/Dockerfile b/docker/develop/Dockerfile new file mode 100644 index 0000000..f1855dd --- /dev/null +++ b/docker/develop/Dockerfile @@ -0,0 +1,30 @@ +# vim: ft=dockerfile + +FROM opensuse/tumbleweed + +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=org.opensuse.example +LABEL org.opencontainers.image.title="cobbler-tftp" +LABEL org.opencontainers.image.description="This image runs the (nearly) stateless Cobbler TFTP server." +LABEL org.opencontainers.image.version="dev.%RELEASE%" +LABEL org.opensuse.reference="registry.opensuse.org/systemsmanagement/cobbler/dev/cobbler-tftp:dev.%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL org.opencontainers.image.created="%BUILDTIME%" +# endlabelprefix + +# ENV Variables we are using. +ENV container docker + +# Custom repository +RUN zypper ar https://download.opensuse.org/repositories/systemsmanagement:/cobbler:/release34/openSUSE_Tumbleweed/ "Cobbler 3.4.x release project" \ + && zypper --gpg-auto-import-keys refresh + +# Dependencies +RUN zypper in -y git \ + python3-devel \ + python3-pip \ + && zypper clean + +WORKDIR /code +EXPOSE 69/UDP +CMD ["/code/docker/develop/entrypoint.sh"] diff --git a/docker/develop/entrypoint.sh b/docker/develop/entrypoint.sh new file mode 100755 index 0000000..8ce7b65 --- /dev/null +++ b/docker/develop/entrypoint.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bash + +pip3 install --break-system-packages -e . +cobbler-tftp start --no-daemon diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile new file mode 100644 index 0000000..9affec8 --- /dev/null +++ b/docker/production/Dockerfile @@ -0,0 +1,33 @@ +# vim: ft=dockerfile +# Define the names/tags of the container +#!BuildTag: cobbler-test-github:release33 cobbler-test-github:release33.%RELEASE% + +# We are using https://github.com/hadolint/hadolint to lint our Dockerfile. +# We don't want to version pin our dependencies for testing. Always retrieve what is up to date. +# hadolint global ignore=DL3037 + +FROM opensuse/leap:15.6 + +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=org.opensuse.example +LABEL org.opencontainers.image.title="cobbler-tftp" +LABEL org.opencontainers.image.description="This image runs the (nearly) stateless Cobbler TFTP server." +LABEL org.opencontainers.image.version="release34.%RELEASE%" +LABEL org.opensuse.reference="registry.opensuse.org/systemsmanagement/cobbler/release34/cobbler-tftp:release34.%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL org.opencontainers.image.created="%BUILDTIME%" +# endlabelprefix + +# ENV Variables we are using. +ENV container docker + +# Custom repository +RUN zypper ar https://download.opensuse.org/repositories/systemsmanagement:/cobbler:/release34/15.6/ "Cobbler 3.4.x release project" \ + && zypper --gpg-auto-import-keys refresh + +# Dev Dependencies +RUN zypper in cobbler-tftp \ + && zypper clean + +EXPOSE 69/UDP +CMD ["cobbler-tftp", "--no-daemon"] diff --git a/docker/rolling/Dockerfile b/docker/rolling/Dockerfile new file mode 100644 index 0000000..816aa4e --- /dev/null +++ b/docker/rolling/Dockerfile @@ -0,0 +1,33 @@ +# vim: ft=dockerfile +# Define the names/tags of the container +#!BuildTag: cobbler-test-github:release33 cobbler-test-github:release33.%RELEASE% + +# We are using https://github.com/hadolint/hadolint to lint our Dockerfile. +# We don't want to version pin our dependencies for testing. Always retrieve what is up to date. +# hadolint global ignore=DL3037 + +FROM opensuse/tumbleweed:latest + +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=org.opensuse.example +LABEL org.opencontainers.image.title="cobbler-tftp" +LABEL org.opencontainers.image.description="This image runs the (nearly) stateless Cobbler TFTP server." +LABEL org.opencontainers.image.version="rolling.%RELEASE%" +LABEL org.opensuse.reference="registry.opensuse.org/systemsmanagement/cobbler/containers/cobbler-tftp:rolling.%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL org.opencontainers.image.created="%BUILDTIME%" +# endlabelprefix + +# ENV Variables we are using. +ENV container docker + +# Custom repository +RUN zypper ar https://download.opensuse.org/repositories/systemsmanagement:/cobbler:/release34/openSUSE_Tumbleweed/ "Cobbler 3.4.x release project" \ + && zypper --gpg-auto-import-keys refresh + +# Dependencies +RUN zypper in -y cobbler-tftp \ + && zypper clean + +EXPOSE 69/UDP +CMD ["cobbler-tftp", "start", "--no-daemon"]