15 Commits
Author SHA1 Message Date
allamaaki80515 07d40c1a9b .drone.yml aktualisiert 2026-04-21 13:21:42 +00:00
allamaaki80515 23976edfa2 .drone.yml aktualisiert 2026-04-21 13:20:42 +00:00
allamaaki80515 6d598b3658 .drone.yml aktualisiert 2026-04-21 13:18:01 +00:00
allamaaki80515 8af70d0b73 .drone.yml aktualisiert 2026-04-21 13:16:26 +00:00
allamaaki80515 3c2fa9c9d1 Dockerfile aktualisiert 2026-04-21 13:07:37 +00:00
allamaaki80515 90ac8902e6 Dockerfile aktualisiert 2026-04-21 12:57:41 +00:00
allamaaki80515 c2943da897 .drone.yml aktualisiert 2026-04-11 11:57:58 +00:00
allamaaki80515 7daec37e62 .drone.yml aktualisiert 2026-04-11 11:55:33 +00:00
allamaaki80515 fca43e2ff2 Dockerfile aktualisiert 2026-04-11 11:52:51 +00:00
allamaaki80515 bdc4592eb4 merge upstream 2026-04-11 11:46:00 +00:00
allamaaki80515 ecfcb3efa3 Dockerfile aktualisiert 2026-04-11 11:44:11 +00:00
allamaaki80515 6f34e1354c Dockerfile aktualisiert 2026-04-11 11:42:15 +00:00
allamaaki80515 2b85e26179 Dockerfile aktualisiert 2026-04-11 11:39:58 +00:00
allamaaki80515 a42486619c Dockerfile aktualisiert 2026-04-11 11:35:45 +00:00
allamaaki80515 ed5ee6a367 Dockerfile aktualisiert 2026-04-11 11:25:21 +00:00
2 changed files with 33 additions and 8 deletions
+3 -3
View File
@@ -46,14 +46,14 @@ steps:
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
# Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline
- git clone https://git.efi.th-nuernberg.de/gitea/allamaaki80515/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline2
# Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts
# Artifact löschen und neu hinzufügen
- git rm image.tar
- rm -f image.tar
- cp $DRONE_WORKSPACE/image.tar .
- git add image.tar
+30 -5
View File
@@ -1,22 +1,47 @@
# Base-Image
FROM ubuntu:latest
#FROM ubuntu:latest
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
#RUN apt-get update && apt-get install -y build-essential gcc curl vim net-tools
# Stage 1: Bauen (mit Alpine + gcc)
FROM alpine:3.21 AS build-env
# Pakete installieren
RUN apk add --no-cache gcc musl-dev
# Arbeitsverzeichnis setzen
WORKDIR /app
# alles kopieren
COPY . .
# alles kopieren --> nur noch deployment.c kopieren!
COPY deployment.c .
# Code kompilieren
RUN gcc -o deployment deployment.c
# Stage 2: Schlankes Runtime-Image
FROM alpine:3.21
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Nicht-Root-User anlegen
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN chown appuser:appgroup /output
# Nur die fertige Binary aus Stage 1 übernehmen
COPY --from=build-env /app/deployment /app/deployment
# Volume für Ausgabe
VOLUME ["/output"]
# Non-root User setzen
USER appuser
# Healthcheck: prüft ob das Output-Verzeichnis erreichbar ist
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD test -d /output || exit 1
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]