Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aagnone3/851c97274a815f7ba5c6ffb0933651c2 to your computer and use it in GitHub Desktop.
Save aagnone3/851c97274a815f7ba5c6ffb0933651c2 to your computer and use it in GitHub Desktop.
# use the name of the current directory as the docker image tag
DOCKERFILE ?= Dockerfile
DOCKER_TAG ?= $(shell echo ${PWD} | rev | cut -d/ -f1 | rev)
DOCKER_IMAGE = ${DOCKER_USERNAME}/${DOCKER_REPO}:${DOCKER_TAG}
$(DOCKERFILE): requirements.txt
docker build \
-t ${DOCKER_IMAGE} \
-f ${DOCKERFILE} \
.
.PHONY image
image: $(DOCKERFILE)
.PHONY: run
run:
nvidia-docker run \
--mount type=bind,source="$(shell pwd)",target=/opt \
-i \
--rm \
-t $(DOCKER_IMAGE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment