Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

2 changed files with 10 additions and 28 deletions

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/schreinerma97192/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline2
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline
# Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts
# Artifact löschen und neu hinzufügen
- git rm -f image.tar || true
- git rm image.tar
- cp $DRONE_WORKSPACE/image.tar .
- git add image.tar

View File

@ -1,40 +1,22 @@
# BUILD STAGE
# Base-Image
FROM cgr.dev/chainguard/wolfi-base:latest AS build
FROM ubuntu:latest
# Pakete installieren
RUN apk update
RUN apk add build-base gcc
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# Arbeitsverzeichnis setzen
WORKDIR /app
# alles kopieren
COPY deployment.c .
COPY . .
# Code kompilieren
RUN gcc -o deployment deployment.c
# RUNTIME STAGE
FROM cgr.dev/chainguard/wolfi-base:latest
RUN adduser -D appuser
RUN mkdir -p /output && chown -R appuser:appuser /output
USER appuser
WORKDIR /app
COPY --from=build /app/deployment .
VOLUME ["/output"]
HEALTHCHECK CMD test -f /output/output.txt || exit 1
# Verzeichnis für Ausgabe anlegen
# RUN mkdir /output
RUN mkdir /output
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]