-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (21 loc) · 771 Bytes
/
Makefile
File metadata and controls
26 lines (21 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
IMAGE_NAME ?= s2geo
CONTAINER ?= s2geo
PLATFORM ?= linux/amd64
.PHONY: build
build: # Build the docker container
sudo docker buildx build --platform ${PLATFORM} -f Dockerfile -t ${IMAGE_NAME} .
.PHONY: clean
clean: # Remove existing container with the same name
# Command shouldn't fail if the container doesnt exist
docker rm ${CONTAINER} || true
.PHONY: run
run: build # Build the container
$(MAKE) clean # Delete the existing container and run a new one
docker run --name ${CONTAINER} -p 8888:8888 -v $(PWD)/notebooks:/usr/src/notebooks -it ${IMAGE_NAME}
.PHONY: start
start: # Start the container
docker start -i ${CONTAINER}
.PHONY: stop
stop: # Stop the container
# Command shouldn't fail if the container doesnt exist
docker stop ${CONTAINER} || true