Compare commits

..

19 Commits
main ... main

2 changed files with 17 additions and 7 deletions

View File

@ -47,13 +47,13 @@ steps:
# Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline
- 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
- git rm --ignore-unmatch image.tar
- cp $DRONE_WORKSPACE/image.tar .
- git add image.tar
@ -64,4 +64,4 @@ steps:
- git pull || true
# Push
- git push
- git push --set-upstream origin drone-artifacts

View File

@ -1,9 +1,10 @@
# Base-Image
FROM ubuntu:latest
FROM alpine:3.20
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
RUN apk add --no-cache build-base gcc curl vim net-tools
# CVE update
#RUN apk upgrade libssl3 libcrypto3 zlib
# Arbeitsverzeichnis setzen
WORKDIR /app
@ -16,7 +17,16 @@ RUN gcc -o deployment deployment.c
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
VOLUME /output
# User erstellen
RUN adduser -D appuser && chown /output appuser
USER appuser
#health
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD pgrep deployment || exit 1
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]