From 64cdde0926aee48b74c90695f91008841ac51ae4 Mon Sep 17 00:00:00 2001 From: Anja Freudenreich Date: Mon, 4 Mar 2024 14:30:23 +0100 Subject: [PATCH] adding a Dockerfile to run a simple C HelloWorld --- Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a335add --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# use alpine as base image +FROM alpine as build-env +# install build-base meta package inside build-env container +RUN apk add --no-cache build-base +# change directory to /app +WORKDIR /app +# copy all files from current directory inside the build-env container +COPY . . +# Compile the source code and generate hello binary executable file +RUN gcc -o hello helloDocker.c +# run the program +ENTRYPOINT ["/app/hello"]