Skip to content

Instantly share code, notes, and snippets.

@joshcarp
Last active April 2, 2020 09:30
Show Gist options
  • Save joshcarp/7ce326413ffbc2ef92c7718821c7ffab to your computer and use it in GitHub Desktop.
Save joshcarp/7ce326413ffbc2ef92c7718821c7ffab to your computer and use it in GitHub Desktop.
Makefile for docker for compsys
FROM gcc:9.2
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN make
CMD ["./main"]
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
all: build
build:
gcc -Wall main.c -o main
docker:
docker build -t joshcarp/compsys:1.0 .
docker run --rm -ti joshcarp/compsys:1.0
docker rm joshcarp/compsys:1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment