-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·46 lines (39 loc) · 1.42 KB
/
Makefile
File metadata and controls
executable file
·46 lines (39 loc) · 1.42 KB
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
.PHONY: build build-all run run-compose clean-all help
# Default distribution
DISTRO ?= ubuntu
help:
@echo "Docker Development Environments"
@echo ""
@echo "Usage:"
@echo " make build DISTRO=<distro> Build a specific Docker image"
@echo " make build-all Build all Docker images"
@echo " make run DISTRO=<distro> Run a container for a specific distribution"
@echo " make run-compose DISTRO=<distro> Run using docker-compose"
@echo " make clean-all Remove all Docker images"
@echo ""
@echo "Available distributions: ubuntu, debian, alpine, arch, kali"
build:
@echo "Building $(DISTRO) image..."
docker build -t dev-$(DISTRO) -f images/$(DISTRO)/Dockerfile .
build-all:
@echo "Building all Docker images..."
@for distro in ubuntu debian alpine arch kali; do \
echo "Building $$distro image..."; \
docker build -t dev-$$distro -f images/$$distro/Dockerfile . || exit 1; \
done
@echo "All images built successfully!"
run:
@echo "Running $(DISTRO) container..."
docker run -it --rm \
-v $$(pwd):/workspace \
-v $$(pwd)/shared:/shared \
--workdir /workspace \
dev-$(DISTRO)
run-compose:
@echo "Running $(DISTRO) container with docker-compose..."
docker-compose up -d $(DISTRO)
docker-compose exec $(DISTRO) bash
clean-all:
@echo "Removing all Docker images..."
docker rmi -f dev-ubuntu dev-debian dev-alpine dev-arch dev-kali 2>/dev/null || true
@echo "All images removed!"