Skip to content

Commit

Permalink
adjust Makefile and create .dockerignore to save time
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Dec 3, 2024
1 parent 108681a commit b6b79e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git/
.idea/
.venv/
bin/
ci/
tests/

**/.mypy_cache/
**/.pytest_cache/
**/__pycache__/
**/*.pyc

**/Dockerfile
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

# https://tech.davis-hansson.com/p/make/
SHELL := bash
# todo: do not set .ONESHELL: for now
Expand Down Expand Up @@ -65,7 +68,7 @@ define build_image
$(eval BUILD_ARGS := --build-arg BASE_IMAGE=$(BASE_IMAGE_NAME)),
$(eval BUILD_ARGS :=)
)
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) -t $(IMAGE_NAME) $(BUILD_ARGS) $(2)
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --tag $(IMAGE_NAME) --file $(2)/Dockerfile $(BUILD_ARGS) $(ROOT_DIR)/
endef

# Push function for the notebok image:
Expand Down

0 comments on commit b6b79e0

Please sign in to comment.