当前位置:网站首页>Centos7 network configuration and docker installation, MySQL image pulling and docker basic commands
Centos7 network configuration and docker installation, MySQL image pulling and docker basic commands
2022-07-16 05:16:00 【Brother radan】
# Summary
1:mimi edition centos7 The network configuration
First step : see VMnet8 Subnets of ip And subnet mask and gateway
vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.137.3
GATEWAY=192.168.137.2
DNS1=192.168.137.2
systemctl restart network Restart the network
ip addr To view the
2:docker
Process level installation
a:docker install
Install the necessary dependent packages
yum install -y yum-utils device-mapper-persistent-data lvm2
Set up Docker Installation source of standard release (aliyun)
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fastUse the source of the development version to install the source
These development repositories are contained in the above docker.repo In file , But it is disabled by default . You can enable them with a stable repository .
yum-config-manager --enable docker-ce-edge
Of course, you can disable it again
yum-config-manager --disable docker-ce-edge
install Docker Community version
yum install docker-ce docker-ce-cli containerd.io
Verify whether the installation and service are normal
docker run hello-world
b:mysql install
docker pull mysql:5.6
docker run -it --name mysql56 -p3307:3306 mysql:5.6
In this way, the data will not be saved
-i : Interactive mode
-t: terminal
–name: The name
Initialize database
MYSQL_ROOT_PASSWORD( Commonly used )
MYSQL_ALLOW_EMPTY_PASSWORD
MYSQL_RANDOM_ROOT_PASSWORD
docker rm mysql56( Delete container )
docker run -it --name mysql56 -p3307:3306 -e MYSQL_ROOT_PASSWORD=password mysql:5.6
3: Scripting language
a: Three startup methods of scripting language
1、source Command usage : source FileName
effect : At present bash Environment to read and execute FileName The command . The filename The file can be empty " Executive authority "
2、sh and bash Command usage : sh FileName bash FileName
effect : In the current corresponding bash Create a new child in the environment shell Read and execute FileName The command . The filename The file can be empty " Executive authority "
3、./ Command usage : ./FileName
effect : Open a sub shell To read and execute FileName In the command .
The file must have executable permissions .
b:linux Script to start the project (.sh)
name ( Make the naming readable )
Comments are ‘#’
windows The next script file is CRLF , stay linux Next is LF
‘#!/bin/bash’ echo $shell
Enter project directory cd /opt/project/hrproject
Update project
if( -a project) Judge whether the current project is
git clone ------ Address
fi
cd hrproject
git push
mvn clean install
pid=‘ps -ef | grep ping’
kill -9 pid
cd target
nohup java -jar hrproject .jar(nohup– Change to background startup )& 2>1 null
c: Start the service
systemctl starter docker && systemctl enable docker
systemctl stay centos7 in
service stay centos6 in
4:git Pull items
opt/apps
opt/project
git clone Address (git The clone address of the project )
maven clean install
java -jar demo-0.0.1-SNAPSHOT.jar
curl http://localhost:8080/login( Page html Code )
5:docker Basic commands
a:docker Basic commands
start-up docker
systemctl start docker
close docker
systemctl stop docker
restart docker
systemctl restart docker
b:docker Mirror command
Check your server docker Image list
docker images
Search mirroring
docker search Mirror name
Pull the mirror image
docker pull Mirror name
docker pull mysql:5.6
delete mirror
docker rmi -f Mirror name / Mirror image ID
c:docker Container order
Run a container
docker run -it -d --name The alias to be taken Mirror name :Tag /bin/bash
View the running container
docker ps
Stop container
docker stop
Delete container
docker rm -f Container name / Containers ID
How to enter the container — Recommended exec The way
docker attach Container name / Containers ID
Start the container
docker start Containers ID/ Container name
docker restart restart
边栏推荐
- 边缘计算 KubeEdge+EdgeMash
- How to realize digital transformation? McKinsey: four steps of digital transformation
- Project management in the eyes of software testers
- Opentext enterprise content management and e-commerce suite integration, integration and management of content for optimal process efficiency and compliance
- OpenText 企业内容管理和电子商务套件集成,整合和管理内容以实现最佳流程效率和合规性
- ObjectARX select entities to create block references
- 上课笔记(3)例题(2)——#567. 庆功会(beanfeast)
- mysql中all用法和any的用法和内连接和外连接,全外连接,联合查询,自连接
- 图像分割方法
- 流批一体在京东的探索与实践
猜你喜欢

自定义类型详解(结构体、枚举,联合)

ssm项目中下拉框功能的实现

系统总出故障怎么办,或许你该学学稳定性建设!

LeNet5、AlexNet、VGGNet、ResNet

C language foundation: n chess

如何编写有效的接口测试?

本周四晚19:00知识赋能第3期直播丨OpenHarmony智能家居项目之控制面板功能实现

ECCV2022 | 腾讯优图29篇论文入选,含人脸安全、图像分割、目标检测等多个研究方向

软件测试人员眼中的项目管理

Niobe 407 of kaihong Zhigu was officially incorporated into the code trunk of openharmony
随机推荐
微信红包项目测试小结
fenxi
架构师进阶,微服务设计与治理的16条常用原则
P1664 每日打卡心情好【入门】
yandex robots txt
如何应对团队协作的五大障碍
ObjectARX select entities to create block references
【面试:并发篇12:多线程:线程八锁】
ECCV2022 | 腾讯优图29篇论文入选,含人脸安全、图像分割、目标检测等多个研究方向
Research and development practice of Kwai real-time warehouse guarantee system
Comment écrire des tests d'interface efficaces?
block yandex bot
分布式单体的六大病症
Dark-blue 主题的大佬,可否加入一个打字机的功能,让打字的时候可以进行选择
1252. Number of odd cells: simple counting simulation problem
[regression prediction LSTM] LSTM implementation based on attention mechanism regression prediction of time series with matlab code
Mindjet MindManager adding image labels
Six diseases of distributed monomers
[英雄星球七月集训LeetCode解题日报] 第13日 双向链表
[interview: concurrent Article 12: multithreading: thread eight locks]