forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a0fcbbd12 |
12
Dockerfile
12
Dockerfile
@ -1,8 +1,9 @@
|
||||
# Base-Image
|
||||
FROM ubuntu:latest AS build
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Pakete installieren
|
||||
RUN apt-get update && apt-get install -y build-essential
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
@ -11,14 +12,11 @@ WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
# Code kompilieren
|
||||
RUN gcc -o deployment deployment.c
|
||||
RUN gcc -o deployment deployment.c
|
||||
|
||||
FROM alpine:latest
|
||||
WORKDIR /app
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
RUN mkdir /output
|
||||
|
||||
COPY --from=build /app/deployment .
|
||||
# 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