-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (38 loc) · 1012 Bytes
/
Makefile
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Name of the Docker image
IMAGE_NAME := endeavouros:latest
# BuildKit environment variable
BUILDKIT := DOCKER_BUILDKIT=0
# Dockerfile path (adjust if your Dockerfile is in a different directory)
DOCKERFILE := Dockerfile
# Target to build the Docker image
.PHONY: build
build:
$(BUILDKIT) docker build -t $(IMAGE_NAME) -f $(DOCKERFILE) .
# Target to clean up intermediate images and containers
.PHONY: clean
clean:
docker rmi -f endeavouros:latest
# Target to remove the Docker image
.PHONY: remove
remove:
docker rmi $(IMAGE_NAME)
# Target to run the Docker container interactively
.PHONY: run
run:
docker run -it $(IMAGE_NAME) /bin/bash
# Target to list all Docker images
.PHONY: images
images:
docker images
# Target to list all Docker containers
.PHONY: ps
ps:
docker ps -a
# Target to stop all running containers
.PHONY: stop
stop:
docker stop $(shell docker ps -q)
# Target to remove all stopped containers
.PHONY: remove-containers
remove-containers:
docker rm $(shell docker ps -a -q)