In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Docker file
Docker creates image in the same directory as the dockerfile file.
Docker build-t xmh:20190718-f / root/xmh30190718/Dockerfile.
Note: xmh:20190718 cannot be uppercase.
Running image is also in the same directory.
Docker run-p 8088 80-d 8becf9e1d3d5
Mongo docker
1. Build docker images
2. Create a docker container
Docker run-d-p 27018 27017-- name mongo_test mongo# of which 27018 can be changed
Docker run-- name= "flaskForFAW"-- p 4004 flaskForFAW 80-d eeb030de7bda
3. Enter docker
Docker exec-it mongo_test / bin/bash
4. Open mongo
Mongo
5. Create new users
Use admin
Db.createUser ({user: "admin", pwd: "admin123", roles: [{role: "root", db: "admin"}]})
6. Quit
Exit ()
Ubuntu
1. Install Ubuntu system commands:
Docker pull ubuntu
This is an extremely compact system, not even the most basic wget command; so first you have to apt-get update upgrade the system and install the apt-get install wget command
2. Run the command to enter the Ubuntu system:
Docker run-ti ubuntu bash
3. Correct way to exit the system:
Press first, ctrl+p
Press again, ctrl+q
Never use exit or ctrl+d to exit, so the whole system will exit!
4. Share the host directory to the Ubuntu system:
Docker run-it-v / AAA:/BBB ubuntu bash
In this way, the AAA folder in the root directory of the host is mapped to the container Ubuntu, and the two can be shared.
5. Log in to the ubuntu image system in docker:
Docker run-ti ubuntu / bin/bash
# 6866 is the first four digits of IMAGE ID-you can tell which image it is.
6. Exit and then enter ubuntu
1. First use docker ps-a to find the corresponding number of the CONTAINER ID (for example: 0a3309a3b29e)
2. Enter the docker attach 0a3309a3b29e of the system (if there is no response at this time, ctrl+c will enter the ubuntu system)
7. Enter docker
Docker exec-it ID/name / bin/bash
8. Add users to mongo in docker
The common way to add a new user will encounter permission problems.
So log in as admin.
Mongo-- port 27017-u admin-p password-- authenticationDatabase admin
Then add the database
Use faw
Add user
Db.createUser ({user: "FAW", pwd: "CASC", roles: [{role: "readWrite", db: "FAW"}], mechanisms: ["SCRAM-SHA-1"]})
Crontab
Apt-get update
Apt-get install cron
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.