Last active
April 2, 2020 09:30
-
-
Save joshcarp/7ce326413ffbc2ef92c7718821c7ffab to your computer and use it in GitHub Desktop.
Makefile for docker for compsys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM gcc:9.2 | |
COPY . /usr/src/myapp | |
WORKDIR /usr/src/myapp | |
RUN make | |
CMD ["./main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
printf("Hello, World!"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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