-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (42 loc) · 1.52 KB
/
docker-compose.yml
File metadata and controls
42 lines (42 loc) · 1.52 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
services:
init:
image: docker:latest
container_name: init
environment:
# The username and password for docker hub if you want to pull images from docker hub.
DOCKER_USERNAME: ${DOCKER_USERNAME}
DOCKER_PASSWORD: ${DOCKER_PASSWORD}
# The url, username and password for your private docker registry if you want to load images from your private docker registry.
PRIVATE_REGISTRY_URL: ${PRIVATE_REGISTRY_URL}
PRIVATE_REGISTRY_USERNAME: ${PRIVATE_REGISTRY_USERNAME}
PRIVATE_REGISTRY_PASSWORD: ${PRIVATE_REGISTRY_PASSWORD}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tapp:/tapp
command:
- /bin/sh
- -c
- |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD &&
docker login -u $PRIVATE_REGISTRY_USERNAME -p $PRIVATE_REGISTRY_PASSWORD $PRIVATE_REGISTRY_URL &&
echo 'login success' &&
echo '
services:
httpbin_example_1:
image: 0xii/httpbin:latest
container_name: httpbin1
ports:
- "1080:80"
' > /tapp/httpbin_example_1.yaml &&
echo '
services:
httpbin_example_2:
image: your-private-registry.com/0xii/httpbin:latest
container_name: httpbin2
ports:
- "1081:80"
' > /tapp/httpbin_example_2.yaml &&
docker compose -f /tapp/httpbin_example_1.yaml up -d &&
docker compose -f /tapp/httpbin_example_2.yaml up -d &&
sleep infinity
restart: "no"