docker install, run, use

https://www.runoob.com/docker/docker-container-connection.html


docker installation, and install mysql, tomcat
docker learning
1. docker installation in different environments
https://www.runoob.com/docker/ubuntu-docker-install.html
2.Docker Hello World
docker run ubuntu: 15.10 / bin / echo "Hello world"

We need to confirm that the container is running. You can use docker ps to view
the container. Use the docker logs + id or name command to view the standard output in the container.
We use the docker stop + id command to stop the container:

Docker container uses
https://www.runoob.com/docker/docker-container-usage.html

Running a web application
The container we ran earlier did not have any particular use.
Next let's try to build a web application using docker.
We will run a Python Flask application in a docker container to run a web application.
runoob @ runoob: ~ # docker pull training / webapp # Load the image
runoob @ runoob: ~ # docker run -d -P training / webapp python app.py
Parameter description:
-d: Let the container run in the background.
-P: Map the network port used inside the container to the host we use.

docker images

Obtaining a new image
When we use a non-existent image on the local host, Docker will automatically download the image. If we want to download this image in advance, we can use the docker pull command to download it.
docker pull ubuntu: 13.10

Finding an image
We can search for an image from the Docker Hub website. The URL of the Docker Hub is: https://hub.docker.com/
We can also use the docker search command to search for an image. For example, we need an httpd image as our web service. We can search httpd through the docker search command to find a suitable image for us.
runoob @ runoob: ~ $ docker search httpd

docker pull tomcat:8.5.42

https://www.cnblogs.com/OliverQin/p/9768267.html

docker cp webtest.war tomcat:/usr/local/tomcat/webapps

https://start.spring.io/


Deploy the application in tomcat
Deploy the application
First upload the prepared war package to the host directory / home through ftp

Enter the app container
[root @ izwz99yhul3o6y7emidjqlz ~] # docker exec -it tomcat (container image name, for example tomcat) bash
root @ cb526f04d30b: / usr / local / tomcat # ls
BUILDING.txt CONTRIBUTING.md LICENSE NOTICE README.md RELEASE-NOTES RUNNING.txt bin conf include lib logs native-jni-lib temp webapps work

root @ cb526f04d30b: / usr / local / tomcat # cd webapps
root @ cb526f04d30b: / usr / local / tomcat / webapps # pwd
/ usr / local / tomcat / webapps
Then we exit the app (exit with the exit command), find the host to store War directory, upload war to webapps

[root @ izwz99yhul3o6y7emidjqlz home] # docker cp ifrs.war tomcat: / usr / local / tomcat / webapps
without restarting, he will deploy by himself

Published 331 original articles · 51 praises · 440,000 visits +

Guess you like

Origin blog.csdn.net/y41992910/article/details/91570917