Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
Privatisation_Deploy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
tianye
Privatisation_Deploy
Commits
0c435574
Commit
0c435574
authored
Jun 07, 2022
by
tianye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入安装Docker,docker-compose
parent
d34bbf16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
db_install.sh
db_install.sh
+38
-0
No files found.
db_install.sh
View file @
0c435574
...
...
@@ -6,6 +6,44 @@ function if_err(){
exit
127
fi
}
function
install_docker
(){
if
which docker
>
/dev/null
;
then
echo
-e
"
\0
33[32m检测到 Docker 已安装,跳过安装步骤
\0
33[0m"
echo
-e
"
\0
33[32m启动 Docker
\0
33[0m "
service docker start 2>&1
else
echo
-e
"
\0
33[32m在线安装 docker
\0
33[0m"
curl
-fsSL
https://get.docker.com
-o
get-docker.sh 2>&1
sudo
sh get-docker.sh
--mirror
Aliyun 2>&1
log
"
\0
33[32m启动 docker...
\0
33[0m"
service docker start 2>&1
fi
}
function
install_docker_compose
(){
if
which docker-compose
>
/dev/null
;
then
echo
-e
"
\0
33[32m检测到 Docker Compose 已安装,跳过安装步骤
\0
33[0m"
else
echo
-e
"
\0
33[32m在线安装 docker-compose
\0
33[0m"
curl
-L
https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-
`
uname
-s
`
-
`
uname
-m
`
-o
/usr/local/bin/docker-compose 2>&1 |
tee
-a
${
__current_dir
}
/install.log
chmod
+x /usr/local/bin/docker-compose
ln
-s
/usr/local/bin/docker-compose /usr/bin/docker-compose
fi
# 检查docker-compose是否正
docker-compose version 1>/dev/null 2>/dev/null
if
[
$?
!=
0
]
;
then
echo
-e
"
\0
33[32mdocker-compose 未正常安装,请先安装 docker-compose 后再次执行本脚本
\0
33[0m"
exit
fi
}
echo
-e
"
\0
33[34m正在检查安装所需环境....
\0
33[0m"
sleep3
#安装Docker
install_docker
if_err
#安装Docker-compose
install_docker_compose
if_err
echo
-e
"
\0
33[32m*欢迎安装Health-cloud-DB服
\0
33[0m "
sleep
3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment