-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.sh
75 lines (50 loc) · 1.12 KB
/
scratch.sh
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
# scratch file for docker 101
exit;
docker ps
# nothing is running
docker run busybox sleep 10
# we are waiting 10 seconds
docker ps -a
# we see that there was a container running
docker run busybox sleep 1000
# keeps running
docker ps
# runnign instance visisble
docker stop
# container is stopped
docker ps -a
# exited with !0 status
docker rm [name]
# remove container
docker ps -a
# it is gone
docker images
# show all the images
docker rmi [name]
# remove image
docker images
# image is gone
docker pull busybox
# pull if you don't have the latest
docker run busybox sleep 1000
docker ps
docker exec [name] cat /etc/hosts
# we get the content
docker stop [name]
docker exec [name] cat /etc/hosts
# no running container
docker run busybox sh -c “while true; do $(echo date); sleep 1; done”
# run something that will make some logging
docker logs [name]
# display the logging
docker logs -f [name]
# follow logging
docker run httpd:alpine
# start container
# it doesn't work :-(
docker ps
docker inspect [name]
# port 80 not mapped
docker run -p 8081:80 httpd:alpine
curl http://localhost:8081
# something is running