Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98422eecdd | |||
| 5814197430 | |||
| 9fd4455348 | |||
| 26a57702d7 | |||
| bd778673a2 | |||
| 4bb7b1de7b | |||
| 8027e9e2ee | |||
| a86e31d69a | |||
| 07efd2bc17 | |||
| cd3a2c263e | |||
| d16a6d8964 |
@ -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/freudenreichan/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline
|
||||
- git clone https://git.efi.th-nuernberg.de/gitea/schreinerma97192/EinfuehrungInDocker_Pipeline2.git
|
||||
- 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 -f image.tar || true
|
||||
- cp $DRONE_WORKSPACE/image.tar .
|
||||
- git add image.tar
|
||||
|
||||
|
||||
32
Dockerfile
32
Dockerfile
@ -1,22 +1,40 @@
|
||||
# BUILD STAGE
|
||||
# Base-Image
|
||||
FROM ubuntu:latest
|
||||
FROM cgr.dev/chainguard/wolfi-base:latest AS build
|
||||
|
||||
# Pakete installieren
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||
RUN apk update
|
||||
RUN apk add build-base gcc
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
|
||||
# alles kopieren
|
||||
COPY . .
|
||||
COPY deployment.c .
|
||||
|
||||
# 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/bash", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user