sandervanvugt

EX188 March 24

Mar 10th, 2024
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.44 KB | None | 0 0
  1. [student@localhost ex188]$ history
  2. 1 sudo subscription-manager register
  3. 2 sudo subscription-manager attach
  4. 3 podman run -it docker.io/library/ubuntu
  5. 4 sudo vim /etc/containers/registries.conf
  6. 5 podman images
  7. 6 podman search ubi9
  8. 7 podman pull registry.redhat.io/ubi9/ubi
  9. 8 podman login registry.redhat.io
  10. 9 podman pull registry.redhat.io/ubi9/ubi
  11. 10 podman images
  12. 11 history
  13. 12 podman ps
  14. 13 podman ps -a
  15. 14 podman run -d ubuntu sleep 3600
  16. 15 podman ps
  17. 16 podman exec -it admiring_kepler sh
  18. 17 podman ps
  19. 18 sudo podman search ubi
  20. 19 sudo podman pull registry.access.redhat.com/ubi8/ubi
  21. 20 podman images
  22. 21 sudo podman images
  23. 22 podman run ubi
  24. 23 podman ps
  25. 24 podman ps -a
  26. 25 podman run ubi echo hello world
  27. 26 podman ps -a
  28. 27 podman run -d nginx
  29. 28 podman run -it ubi /bin/bash
  30. 29 podman ps
  31. 30 sudo dnf install -y git
  32. 31 git clone https://github.com/sandervanvugt/ex188
  33. 32 cd ex188/
  34. 33 ls
  35. 34 history
  36. 35 podman run -d docker.io/library/nginx
  37. 36 sudo ip a
  38. 37 podman inspect -l -f "{{.NetworkSettings.IPAddress}}"
  39. 38 sudo podman run -d nginx
  40. 39 sudo ip a
  41. 40 sudo podman inspect -l -f "{{.NetworkSettings.IPAddress}}"
  42. 41 sudo ps faux | less
  43. 42 podman run --name myweb -it nginx sh
  44. 43 podman ps
  45. 44 podman inspect myweb
  46. 45 podman inspect myweb | less
  47. 46 podman ps -a
  48. 47 podman inspect b628
  49. 48 sudo find /home/student -name "b628*"
  50. 49 podman image inspect nginx | less
  51. 50 podman attach myweb
  52. 51 podman ps
  53. 52 podman ps -a
  54. 53 history
  55. 54 podman run docker.io/library/mariadb
  56. 55 podman ps -a
  57. 56 podman logs sweet_hodgkin
  58. 57 podman run -d -e MYSQL_ROOT_PASSWORD=password mariadb
  59. 58 podman ps
  60. 59 podman network ls
  61. 60 podman network inspect 2f2
  62. 61 sudo -i
  63. 62 podman run -d -p 8088:80 nginx
  64. 63 curl localhost:8080
  65. 64 curl localhost:8088
  66. 65 podman ps
  67. 66 podman port
  68. 67 podman port c3
  69. 68 ss tunZap
  70. 69 ss tunap
  71. 70 sudo ss tunap
  72. 71 sudo ss -tunap
  73. 72 sudo ss -tunapZ
  74. 73 man podman-run
  75. 74 history
  76. 75 podman images
  77. 76 podman image tree 8d2
  78. 77 podman image tree e47
  79. 78 podman inspect ceb
  80. 79 podman image tree -h
  81. 80 podman image tree --whatrequires e47
  82. 81 podman image inspect ceb
  83. 82 podman image inspect ceb365432eec
  84. 83 podman run --name customweb -it nginx sh
  85. 84 podman commit customweb nginx:custom
  86. 85 podman images
  87. 86 podman run -it localhost/nginx:custom ls -l /tmp/testfile
  88. 87 ls
  89. 88 cd sample-containerfile/
  90. 89 ls
  91. 90 vim Containerfile
  92. 91 podman build -t nmap:latest .
  93. 92 podman images
  94. 93 cd ..
  95. 94 mkdir demo
  96. 95 cd demo
  97. 96 vim Containerfile
  98. 97 podman build -t myapp
  99. 98 podman build -t myapp .
  100. 99 podman images
  101. 100 podman run localhost/nmap:latest
  102. 101 podman run -it localhost/nmap:latest sh
  103. 102 cd ../sample-containerfile/
  104. 103 vim Containerfile
  105. 104 podman build -t alpmap .
  106. 105 podman images
  107. 106 podman run alpmap
  108. 107 podman run -it alpmap sh
  109. 108 vim Containerfile
  110. 109 podman run -it alpmap sh
  111. 110 podman build -t alpmap .
  112. 111 podman images
  113. 112 cd ../multistage-containerfile/
  114. 113 vim Containerfile
  115. 114 podman build -t multi .
  116. 115 podman images
  117. 116 podman run multi
  118. 117 podman image tree multi
  119. 118 podman image tree 033c
  120. 119 cd ..
  121. 120 ls
  122. 121 cd advanced-containerfile/
  123. 122 ls
  124. 123 vim Containerfile
  125. 124 history
  126. 125 cd ..
  127. 126 git pull
  128. 127 cd countdown-containerfile/
  129. 128 vim Containerfile
  130. 129 podman build -t countdown .
  131. 130 podman run countdown
  132. 131 podman run countdown 2
  133. 132 podman volume lsit
  134. 133 podman volume list
  135. 134 podman volume inspect 03df3fb3275955c88a7de458c5db4f0226a289e22d78999f7e945a18fbcb2844
  136. 135 date
  137. 136 podman volume inspect 623f57514d73b630355d4ff320ac2f442c96fcc12778aec9c485d8ca16de243f
  138. 137 less /home/student/.local/share/containers/storage/volumes/623f57514d73b630355d4ff320ac2f442c96fcc12778aec9c485d8ca16de243f/_data
  139. 138 cd ..
  140. 139 mkdir anna
  141. 140 vim Containerfile
  142. 141 podman build --build-arg user=anna -t argtest .
  143. 142 podman build --build-arg arguser=anna -t argtest .
  144. 143 podman ps
  145. 144 podman images
  146. 145 podman run argtest:latest
  147. 146 ls
  148. 147 cd anna
  149. 148 ls
  150. 149 cd ..
  151. 150 vim Containerfile
  152. 151 mkdir another
  153. 152 cd another/
  154. 153 vim Containerfile
  155. 154 podman build -t sleeper .
  156. 155 podman run -d --name sleeper sleeper
  157. 156 podman top sleeper huser user
  158. 157 vim Containerfile
  159. 158 podman build -t sleeper2 .
  160. 159 podman run -d --name sleeper2 sleeper2:latest
  161. 160 podman top sleeper2 huser user
  162. 161 sudo systemctl enable --now podman restart.service
  163. 162 sudo systemctl enable --now podman-restart.service
  164. 163 podman run -d -p 5000:5000 --restart=always --name docker.io/library/registry/registry:latest
  165. 164 podman run -d -p 5000:5000 --restart=always --name registry docker.io/library/registry/registry:latest
  166. 165 podman run -d -p 5000:5000 --restart=always --name registry docker.io/library/registry
  167. 166 podman pull fedora
  168. 167 podman images
  169. 168 podman images | grep fed
  170. 169 podman tag fedora:latest localhost:5000/myfedora
  171. 170 podman push localhost:5000/myfedora
  172. 171 podman push --tls-verify=false localhost:5000/myfedora
  173. 172 podman rmi fedora:latest
  174. 173 podman exec -it registry sh
  175. 174 podman pull localhost:5000/myfedora
  176. 175 podman pull --tls-verify=false localhost:5000/myfedora
  177. 176 podman image tree sleeper
  178. 177 podman image tree sleeper2
  179. 178 podman exec -it sleeper2 touch /tmp/smallfile
  180. 179 #
  181. 180 podman ps
  182. 181 ls ~/.local/share/containers/storage/overlay-containers/05ef40a40dc9f5c70d64b4a2f693c1e165676f2d40287b623b32fd9fb977b101/userdata/
  183. 182 podman volume -h | less
  184. 183 man podman-volume
  185. 184 podman volume create webdata
  186. 185 podman volume inspect webdata
  187. 186 podman run -d -p 8080:8080 --volume webdata:/var/www/html docker.io/bitnami/nginx
  188. 187 podman exec -it 5bd8542b8ff3 touch /var/www/html/friday
  189. 188 ls -Zd /home/student/.local/share/containers/storage/volumes/webdata
  190. 189 ls -Zd /home/student/.local/share/containers/storage/volumes/webdata/_data
  191. 190 history
  192. 191 cd
  193. 192 mkdir /home/student/dbfiles
  194. 193 podman run -d -v /home/student/dbfiles:/var/lib/mysql:Z -e MYSQL_ROOT_PASSWORD=password registry.access.redhat.com/rhscl/mysql-80-rhel7
  195. 194 ls -ld /home/student/dbfiles
  196. 195 podman inspect registry.access.redhat.com/rhscl/mysql-80-rhel7:latest | grep User
  197. 196 podman unshare ls -ld /home/student/dbfiles/
  198. 197 podman unshare chown 27:27 -R dbfiles/
  199. 198 podman unshare ls -ld /home/student/dbfiles/
  200. 199 ld -ld dbfiles/
  201. 200 ls -ld dbfiles/
  202. 201 podman top -l user huser
  203. 202 history
  204. 203 podman ps -a
  205. 204 podman logs nifty_lamarr
  206. 205 history
  207. 206 podman run -d -v /home/student/dbfiles:/var/lib/mysql:Z -e MYSQL_ROOT_PASSWORD=password registry.access.redhat.com/rhscl/mysql-80-rhel7
  208. 207 podman ps
  209. 208 ls -dZ dbfiles/
  210. 209 podman volume create mysqldata
  211. 210 podman volume list
  212. 211 podman network create datanet
  213. 212 podman network list
  214. 213 podman network ls
  215. 214 podman run -d --name persistent-mysql -e MARIADB_ROOT_PASSWORD=password -v mysqldata:/var/lib/mysql --network=datanet docker.io/bitnami/mariadb
  216. 215 podman os
  217. 216 podman ps
  218. 217 history
  219. 218 podman run -d -p 8080:80 --name bitweb docker.io/bitnami/nginx
  220. 219 podman run -d -p 8081:80 --name bitweb docker.io/bitnami/nginx
  221. 220 podman rm bitweb
  222. 221 podman run -d -p 8081:80 --name bitweb docker.io/bitnami/nginx
  223. 222 podman port bitweb
  224. 223 curl localhost:8081
  225. 224 podman exec -it bitweb ss -pant
  226. 225 export BITWEBPORT=$(podman inspect bitweb --format '{{.State.Pid}}')
  227. 226 echo $BITWEBPORT
  228. 227 sudo nsenter -n -t $BITWEBPORT ss -pant
  229. 228 podman kill bitweb
  230. 229 podman rm bitweb
  231. 230 podman run -d -p 8081:8080 --name bitweb docker.io/bitnami/nginx
  232. 231 curl localhost:8080
  233. 232 curl localhost:8081
  234. 233 sudo subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms
  235. 234 sudo dnf install https://di.fedoraproject.org/pub/epel-release-latest-9.noarch.rpm
  236. 235 sudo dnf install https://dl.fedoraproject.org/pub/epel-release-latest-9.noarch.rpm
  237. 236 sudo dnf install podman-compose
  238. 237 ls *yaml
  239. 238 ls
  240. 239 cd ex188/
  241. 240 ls
  242. 241 vim compose.yaml
  243. 242 sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
  244. 243 sudo dnf install podman-compose
  245. 244 podman-compose up -d
  246. 245 history
  247.  
  248. ###ROOT HISTORY
  249. [root@localhost ~]# history
  250. 1 podman network create alpine-net
  251. 2 podman network ls
  252. 3 podman network inspect alpine-net
  253. 4 podman run -dit --name alpine1 --network alpine-net docker.io/library/alpine ash
  254. 5 podman run -dit --name alpine2 --network alpine-net docker.io/library/alpine ash
  255. 6 podman run -dit --name alpine3 alpine ash
  256. 7 podman run -dit --name alpine4 --network alpine-net alpine ash
  257. 8 podman network connect podman alpine4
  258. 9 podman container ls
  259. 10 podman network inspect podman
  260. 11 podman network inspect alpine-net
  261. 12 podman container attach alpine1
  262. 13 exit
  263. 14 history
  264.  
Advertisement
Add Comment
Please, Sign In to add comment