Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf7266c9c2 | |||
| 156bf8ea59 |
@ -47,7 +47,7 @@ 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
|
||||||
@ -64,4 +64,4 @@ steps:
|
|||||||
- git pull || true
|
- git pull || true
|
||||||
|
|
||||||
# Push
|
# Push
|
||||||
- git push
|
- git push
|
||||||
|
|||||||
37
Dockerfile
37
Dockerfile
@ -1,22 +1,29 @@
|
|||||||
# Base-Image
|
FROM alpine:3.20 AS builder
|
||||||
FROM ubuntu:latest
|
|
||||||
|
|
||||||
# Pakete installieren
|
RUN apk add --no-cache build-base
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
WORKDIR /app
|
||||||
|
COPY deployment.c .
|
||||||
|
|
||||||
|
RUN gcc -O2 -o deployment deployment.c
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
|
|
||||||
# Arbeitsverzeichnis setzen
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# alles kopieren
|
COPY --from=builder /app/deployment /app/deployment
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Code kompilieren
|
RUN mkdir -p /output && chown -R appuser:appgroup /app /output
|
||||||
RUN gcc -o deployment deployment.c
|
|
||||||
|
|
||||||
# Verzeichnis für Ausgabe anlegen
|
USER appuser
|
||||||
RUN mkdir /output
|
|
||||||
|
|
||||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
VOLUME ["/output"]
|
||||||
ENTRYPOINT ["/bin/bash", "-c"]
|
|
||||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||||
|
CMD test -f /output/output.txt || exit 1
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/sh", "-c"]
|
||||||
|
CMD ["./deployment 10 >> /output/output.txt && tail -f /output/output.txt"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user