Skip to content

Commit

Permalink
Docker: Initial add of containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
SchoolGuy committed Jun 23, 2024
1 parent 2060f2c commit 0a70f44
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docker/develop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# vim: ft=dockerfile

FROM opensuse/tumbleweed

Check warning on line 3 in docker/develop/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docker/develop/Dockerfile#L3

Always tag the version of an image explicitly

# 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"]
4 changes: 4 additions & 0 deletions docker/develop/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/bash

pip3 install --break-system-packages -e .
cobbler-tftp start --no-daemon
33 changes: 33 additions & 0 deletions docker/production/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
33 changes: 33 additions & 0 deletions docker/rolling/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 9 in docker/rolling/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docker/rolling/Dockerfile#L9

Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

# 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"]

0 comments on commit 0a70f44

Please sign in to comment.