Miau
This commit is contained in:
parent
dea458fcb2
commit
d16a6d8964
24
Dockerfile
24
Dockerfile
@ -1,5 +1,6 @@
|
|||||||
|
# BUILD STAGE
|
||||||
# Base-Image
|
# Base-Image
|
||||||
FROM ubuntu:latest
|
FROM debian:stable-slim AS build
|
||||||
|
|
||||||
# Pakete installieren
|
# Pakete installieren
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
@ -9,14 +10,29 @@ RUN apt-get install -y build-essential gcc curl vim net-tools
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# alles kopieren
|
# alles kopieren
|
||||||
COPY . .
|
COPY deployment.c .
|
||||||
|
|
||||||
# Code kompilieren
|
# Code kompilieren
|
||||||
RUN gcc -o deployment deployment.c
|
RUN gcc -o deployment deployment.c
|
||||||
|
|
||||||
|
|
||||||
|
# RUNTIME STAGE
|
||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
RUN useradd -m appuser
|
||||||
|
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/bash", "-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"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user