-
Notifications
You must be signed in to change notification settings - Fork 0
/
script
65 lines (42 loc) · 1.47 KB
/
script
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
# Build demo1
docker build -t consumer/nginx:latest demo1
# Show images
docker images
# Run demo1
docker run -d -p 8080:80 consumer/nginx
# Run ps
docker ps
# Tail the logs
docker logs -f
# Copy URL to hit demo1 webserver
open `echo -n http://$(boot2docker ip 2>/dev/null | awk '{print $NF}'):8080`
# Change URL path to something that doesn't exist
# Stop docker container
docker stop $(docker ps | grep -v CONTAINER | awk '{print $1}')
# Remove the docker container
docker rm $(docker ps -a | grep -v CONTAINER | awk '{print $1}')
# Show differences between demo1 and demo2
ksdiff demo1 demo2
# Build demo2
docker build -t consumer/nginx:latest demo2
# Show images, explain caching
docker images
# Remove obsolete images
docker rmi $(docker images | grep "<none>" | awk '{print $3}')
# Run demo2
docker run -d -p 8080:80 consumer/nginx
# Stop/Remove all docker containers
export PID=$(docker ps -a | grep -v CONTAINER | awk '{print $1}') && docker stop $PID && docker rm $PID
# Open the registry
open https://registry.hub.docker.com/
docker search nginx | more
# Show differences between demo2 and demo3
ksdiff demo2 demo3
# Build demo3
docker build -t consumer/nginx:latest demo3
# Run demo3
docker run -d -p 8080:80 consumer/nginx
# Stop/Remove all docker containers
export PID=$(docker ps -a | grep -v CONTAINER | awk '{print $1}') && docker stop $PID && docker rm $PID
# POST DEMO: Clean up all docker images
docker images | grep -v REPOSITORY | awk '{print $3}' | xargs docker rmi