-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Dockerfile and dock script
- Loading branch information
1 parent
96c0da9
commit 17378df
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && apt-get -y install \ | ||
git make gdb python3-dev \ | ||
libbsd-dev libc6-dev gcc-multilib linux-libc-dev \ | ||
seabios qemu-system-x86 | ||
|
||
WORKDIR /sched |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
## | ||
## Usage: dock {build|run|exec} | ||
## | ||
|
||
DOCKER="docker" | ||
EXEC_CMD="exec" | ||
BUILD_CMD="build" | ||
RUN_CMD="container run" | ||
CONTAINER_NAME="sched" | ||
IMAGE_NAME="fisop-sched" | ||
|
||
usage() { | ||
echo "Usage: $0 {build|run|exec}" | ||
exit 1 | ||
} | ||
|
||
build_container() { | ||
$DOCKER $BUILD_CMD -t $IMAGE_NAME -f Dockerfile . | ||
} | ||
|
||
run_container() { | ||
$DOCKER $RUN_CMD -it --rm --name=$CONTAINER_NAME -v $(pwd):/sched $IMAGE_NAME bash | ||
} | ||
|
||
exec_container() { | ||
$DOCKER $EXEC_CMD -it $CONTAINER_NAME bash | ||
} | ||
|
||
main() { | ||
case $1 in | ||
"build") | ||
build_container | ||
;; | ||
"run") | ||
run_container | ||
;; | ||
"exec") | ||
exec_container | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
|
||
} | ||
|
||
main $1 |