-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
74 lines (65 loc) · 2 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
DEX_IMAGE ?= quay.io/minio/dex:latest
LDAP_IMAGE ?= quay.io/minio/openldap:latest
all: docker-images
docker-push: docker-images
@docker push $(LDAP_IMAGE)
@docker push $(DEX_IMAGE)
docker-images:
@(cd ldap && docker build -t $(LDAP_IMAGE) .)
@(cd openid && docker build -t $(DEX_IMAGE) .)
ldap-service:
docker run \
-p 389:389 -p 636:636 --name openldap \
--env LDAP_ORGANIZATION="MinIO Inc." \
--env LDAP_DOMAIN="min.io" \
--env LDAP_ADMIN_PASSWORD="admin" \
--hostname openldap \
--detach \
$(LDAP_IMAGE) --copy-service
openid-service:
docker run \
--net=host \
-p 5556:5556 \
--name dex \
--detach \
$(DEX_IMAGE)
docker run \
--net=host \
-p 5557:5557 \
--env DEX_ISSUER="http://127.0.0.1:5557/dex" \
--env DEX_WEB_HTTP="0.0.0.0:5557" \
--name dex-2 \
--detach \
$(DEX_IMAGE)
docker-run: ldap-service openid-service
podman-images:
(cd ldap && podman build -t $(LDAP_IMAGE) .)
(cd openid && podman build -t $(DEX_IMAGE) .)
# Run OpenLDAP (exposed on localhost:389,636) and two Dex instances (exposed
# at localhost:5556 and localhost:5557).
podman-run:
podman pod create --name iam-testing -p 389:389 -p 636:636 -p 5556:5556 -p 5557:5557
podman pod start iam-testing
podman run \
--env LDAP_ORGANIZATION="MinIO Inc." \
--env LDAP_DOMAIN="min.io" \
--env LDAP_ADMIN_PASSWORD="admin" \
--name openldap \
--pod iam-testing \
--detach \
$(LDAP_IMAGE) --copy-service
podman run \
--name dex \
--pod iam-testing \
--detach \
$(DEX_IMAGE)
podman run \
--env DEX_ISSUER="http://127.0.0.1:5557/dex" \
--env DEX_WEB_HTTP="0.0.0.0:5557" \
--name dex-2 \
--pod iam-testing \
--detach \
$(DEX_IMAGE)
clean:
@podman pod rm -f iam-testing || echo "[Podman] Pod iam-testing does not exist"
@docker rm -f openldap dex dex-2 || echo "[Docker] Clean!"