-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from gosha20777/dev
Dev update makefile
- Loading branch information
Showing
2 changed files
with
48 additions
and
2 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
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,47 @@ | ||
|
||
# Version for docker images from git | ||
RLA_VERSION := $(shell git describe --abbrev=0 --tags) | ||
|
||
# Build both docker images | ||
.PHONY: build-all | ||
build-all: build build-gpu | ||
|
||
|
||
# Build docker image. Application using GPU (nvidia docker needed) | ||
.PHONY: build-gpu | ||
build-gpu: | ||
docker build --file Dockerfile.gpu -t rescuer_la:$(RLA_VERSION)-gpu . | ||
|
||
# Build docker image. Application using CPU | ||
.PHONY: build | ||
build: | ||
docker build -t rescuer_la:$(RLA_VERSION) . | ||
|
||
# Build and run docker image. Application using CPU | ||
.PHONY: run | ||
run: build | ||
docker run --rm \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-e DISPLAY=unix$(DISPLAY) \ | ||
--workdir=$(pwd) \ | ||
--volume="/home/$(USER):/home/$(USER)" \ | ||
--volume="/etc/group:/etc/group:ro" \ | ||
--volume="/etc/passwd:/etc/passwd:ro" \ | ||
--volume="/etc/shadow:/etc/shadow:ro" \ | ||
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \ | ||
rescuer_la:$(RLA_VERSION) | ||
|
||
# Build and run docker image. Application using GPU | ||
run-gpu: build-gpu | ||
docker run --rm \ | ||
--runtime=nvidia \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-e DISPLAY=unix$(DISPLAY) \ | ||
--workdir=$(pwd) \ | ||
--volume="/home/$(USER):/home/$(USER)" \ | ||
--volume="/etc/group:/etc/group:ro" \ | ||
--volume="/etc/passwd:/etc/passwd:ro" \ | ||
--volume="/etc/shadow:/etc/shadow:ro" \ | ||
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \ | ||
rescuer_la:$(RLA_VERSION)-gpu | ||
|