Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

YUM:

yum is the primary tool for getting, installing, deleting, querying, and
managing Red Hat Enterprise Linux RPM software packages from official Red
Hat software repositories, as well as other third-party repositories.
yum is used in Red Hat Enterprise Linux versions 5 and later. Versions of Red
Hat Enterprise Linux 4 and earlier used up2date.

Know the name of OS, Kernal version and date etc : uname -a
Start Docker on Linux: sudo service docker start
Show all docker images : docker images

Show running docker containers : docker ps


Process id of application: pidof docker or ps ax | grep docker
Run Docker image : docker run -it --rm httpd-2.4.18:1

Run Docker:
In Background : docker run -d -p 90:80 --name httpd-2.4.18 httpd-2.4.18:1
In interactive mode : docker run -it --rm -p 90:80 --name httpd-2.4.18 httpd-2.4.18:1
(once stopped remove automatically)
Open container terminal : docker exec -it httpd-2.4.18 bash

Stop and remove docker


docker rm f httpd-2.4.18 (container name)

Docker start, stop and remove (container name is used after command not
image name)
docker start httpd-2.4.18
docker stop httpd-2.4.18
docker rm httpd-2.4.18

Running Dockers
Docker ps Shows only running docker
Docker ps a shows all docker including stopped one and started one.
Remove all the container:

docker rm $(docker ps -a -q)

Volume Data Container:


Inspect : docker inspect drupal_data
See data: docker run --rm --volumes-from drupal_data drupal_mysql ls
/var/lib/mysql
O/P: auto.cnf
drupal
ib_logfile0
ib_logfile1
ibdata1
mysql
mysql.sock
performance_schema
testdb

Copy data from drupal_data: docker cp drupal_data:/var/lib/mysql .


Itll copy entire mysql folder. That folder will have all databases.

Delete data container : docker rm --force --volumes drupal_data


O/P : Name of container (drupal_data)

wget --no-check-certificate https://localhost:8443

You might also like