forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a0fcbbd12 |
@ -47,13 +47,13 @@ steps:
|
||||
|
||||
# Repo clonen
|
||||
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline2
|
||||
- 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 --ignore-unmatch image.tar
|
||||
- git rm image.tar
|
||||
- cp $DRONE_WORKSPACE/image.tar .
|
||||
- git add image.tar
|
||||
|
||||
@ -64,4 +64,4 @@ steps:
|
||||
- git pull || true
|
||||
|
||||
# Push
|
||||
- git push --set-upstream origin drone-artifacts
|
||||
- git push
|
||||
18
Dockerfile
18
Dockerfile
@ -1,10 +1,9 @@
|
||||
# Base-Image
|
||||
FROM alpine:3.20
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Pakete installieren
|
||||
RUN apk add --no-cache build-base gcc curl vim net-tools
|
||||
# CVE update
|
||||
#RUN apk upgrade libssl3 libcrypto3 zlib
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
@ -17,16 +16,7 @@ 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/sh", "-c"]
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
Loading…
x
Reference in New Issue
Block a user