9 Commits
Author SHA1 Message Date
voelkeraa97496 9ff2031d4a .drone.yml aktualisiert 2026-05-17 16:29:52 +00:00
voelkeraa97496 952cf78f45 .drone.yml aktualisiert 2026-05-17 16:26:57 +00:00
voelkeraa97496 cbc5aafb24 .drone.yml aktualisiert 2026-05-17 16:24:18 +00:00
voelkeraa97496 78c168f9de Dockerfile aktualisiert 2026-05-17 16:18:04 +00:00
voelkeraa97496 f3629abddf Dockerfile aktualisiert 2026-05-17 16:14:57 +00:00
voelkeraa97496 3f6c9e3be1 Dockerfile aktualisiert 2026-05-17 16:11:50 +00:00
voelkeraa97496 af81140fa3 Dockerfile aktualisiert 2026-05-17 16:10:55 +00:00
voelkeraa97496 4c578ea2c2 Dockerfile aktualisiert 2026-05-17 16:07:12 +00:00
voelkeraa97496 4dbcf50614 Dockerfile aktualisiert 2026-04-11 12:02:33 +00:00
2 changed files with 30 additions and 18 deletions
+3 -3
View File
@@ -47,13 +47,13 @@ steps:
# Repo clonen # Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git - git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline - cd EinfuehrungInDocker_Pipeline2
# Branch wechseln oder erstellen # Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts - git checkout drone-artifacts || git checkout -b drone-artifacts
# Artifact löschen und neu hinzufügen # Artifact löschen und neu hinzufügen
- git rm image.tar - rm -f image.tar
- cp $DRONE_WORKSPACE/image.tar . - cp $DRONE_WORKSPACE/image.tar .
- git add image.tar - git add image.tar
@@ -64,4 +64,4 @@ steps:
- git pull || true - git pull || true
# Push # Push
- git push - git push --set-upstream origin drone-artifacts
+27 -15
View File
@@ -1,22 +1,34 @@
# Base-Image FROM alpine:3.20
FROM ubuntu:latest
# Pakete installieren # gcc installieren
RUN apt-get update RUN apk add --no-cache gcc musl-dev
RUN apt-get install -y build-essential gcc curl vim net-tools
# Arbeitsverzeichnis setzen # Arbeitsverzeichnis
WORKDIR /app WORKDIR /app
# alles kopieren # Dateien kopieren
COPY . . COPY deployment.c .
# Code kompilieren # Programm kompilieren
RUN gcc -o deployment deployment.c RUN gcc -O2 -o deployment deployment.c
# Verzeichnis für Ausgabe anlegen # Non-root User
RUN mkdir /output RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Ausgabe wird ins Container-Dateisystem geschrieben # Output-Verzeichnis
ENTRYPOINT ["/bin/bash", "-c"] RUN mkdir /output && chown -R appuser:appgroup /output /app
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
# Datavolume
VOLUME ["/output"]
# User wechseln
USER appuser
# Healthcheck
HEALTHCHECK CMD test -f /output/output.txt || exit 1
# Anwendung starten
CMD ["/bin/sh", "-c", "./deployment 10 > /output/output.txt"]
# Start
CMD ["/app/deployment", "10"]