04-Jun-2021 Docker
04-Jun-2021 Docker
--------------------
Working on Images
-------------------------
1 To download a docker image
docker pull image_name
5) To tag an image
docker tag image_name ipaddress_of_local_registry:5000/image_name
++++++++++++++++++++++++++++++++++++++++++++++
Working on containers
-----------------------------
24) To go into the shell of a running contianer which is moved into background
docker attach container_name/container id
++++++++++++++++++++++++++++++++++++++++++++++++
-p Used for port mapping between port of container with the dockerhost port.
-P Used for automatic port mapping ie, it will map the internal port of the
container
with some port on host machine.
This host port will be some number greater than 30000
--memory Used to specify the maximum amount of ram that the container can use
++++++++++++++++++++++++++++++++++++++++++++++++++=
# docker images
# docker stop c1
# docker rm -f c1
( The above command runs tomcat in detached mode , so we get out # prompt back )
# docker container ls
TO start jenkins
# docker run --name myjenkins -p 9090:8080 -d jenkins
+++++++++++++
Scenario 1:
Start tomcat as a container and name it as "webserver". Perform port mapping and
run this container in detached mode
++++++++++++++++++++++++++++++++
Scenario 2:
Start jenkins as a container in detached mode , name is as "devserver", perform
port mapping
++++++++++++++++++++++++++++++++++++++++
How to check nginx is running or not? ( we do not know the port number)
80 is nginx port
32768 is dockerhost port
or
++++++++++++++++++++++++++
To start centos as container
++++++++++++++
How to check nginx is running or not? ( we do not know the port number)
80 is nginx port
32768 is dockerhost port
or
++++++++++++++++++++++++++
To start centos as container
++++++++++++++
# docker container ls
TO switch to a databse
> use db_name
> use mysql
https://justinsomnia.org/2009/04/the-emp-and-dept-tables-for-mysql/
> exit
# exit
# exit