forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Some checks reported errors
continuous-integration/drone/push Build was killed
39 lines
719 B
Docker
39 lines
719 B
Docker
# BUILD STAGE
|
|
# Base-Image
|
|
FROM debian:stable-slim AS build
|
|
|
|
# Pakete installieren
|
|
RUN apt-get update
|
|
RUN apt-get install -y build-essential gcc curl vim net-tools
|
|
|
|
# Arbeitsverzeichnis setzen
|
|
WORKDIR /app
|
|
|
|
# alles kopieren
|
|
COPY deployment.c .
|
|
|
|
# Code kompilieren
|
|
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
|
|
# RUN mkdir /output
|
|
|
|
# Ausgabe wird ins Container-Dateisystem geschrieben
|
|
ENTRYPOINT ["/bin/bash", "-c"]
|
|
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|