Lab 2 – Docker – 3 July 2023

How to use container?

How to use container?
---------------------
How to go inside a container?
$ docker exec cont cmd

How to access from outside?

 589  docker create httpd
  590  docker start fb8e68fd7ddf4207ae129bdc2f0efebe0bafdd7c390b0ccb43b7377afc9d046c
  591  docker ps
  592  docker exec fb8e68fd7ddf ls
  593  docker exec fb8e68fd7ddf df -kh
  594  clear
  595  ls
  596  docker ps
  597  docker exec -it fb8e68fd7ddf /bin/bash
  598  cleat
  599  cler
  600  clear
  601  docker ps
  602  docker inspect fb8e68fd7ddf
  603  curl http://172.17.0.2
========================================

RUN
------------------------------------
pull + create + start + attach (attach pid 1 of the container.

RUN -d
------------------------------------
pull + create + start + DO not attach (attach pid 1 of the container.


PS is running		vs is running		Container is running
as long as pid1		as long as pid1		as long as pid1
is running		is running		is running

SYSTEMD			SYSTEMD			ANYTHING

 606  ps
  607  docker ps
  608  docker exec fb8e68fd7ddf ps -eaf
  609  docker run -itd ubuntu
  610  docker ps
  611  docker exec 144361c8cb59 ps -eaf
  612  docker attach 144361c8cb59
  613  clear
  614  docker ps
  615  docker ps -a
  616  docker start 144361c8cb59
  617  docker attach 144361c8cb59
  618  docker ps -a
  619  docker attach fb8e68fd7ddf
  620  docker ps
  621  docker ps -a
  622  clear
  623  ls
  624  ps -eaf
  625  clear
  626  docker -s
  627  clear
  628  docker ps
  629  docker ps -a
  630  docker start  fb8e68fd7ddf 144361c8cb59
  631  docker ps -a
  632  docker attach 144361c8cb59
  633  docker attach fb8e68fd7ddf
  634  clear
  635  docker ps



  638  docker run -d -p 80:80 httpd
  639  docker run -d -p 81:80 httpd
  640  docker run -d -p 82:80 httpd
  641  docker run -d -p 83:80 httpd
  642  docker ps a
  643  docker ps
  644  docker run -d httpd
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Pankaj
Pankaj
11 months ago

Its works

1
0
Would love your thoughts, please comment.x
()
x