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 #- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
# Repo clonen # Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/schreinerma97192/EinfuehrungInDocker_Pipeline2.git - git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline2 - cd EinfuehrungInDocker_Pipeline
# 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 -f image.tar || true - git rm image.tar
- cp $DRONE_WORKSPACE/image.tar . - cp $DRONE_WORKSPACE/image.tar .
- git add image.tar - git add image.tar

View File

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