mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
[REV] Support install docker and dockker compose automatic for exeport application run scripte.
This commit is contained in:
parent
9f884a6cc3
commit
089c735422
@ -7,10 +7,10 @@ ENV PKG_URL="http://goodrain-pkg.oss-cn-shanghai.aliyuncs.com/pkg" \
|
||||
|
||||
RUN apk --no-cache add openssl git perl openssh-client && \
|
||||
curl $PKG_URL/labor_docker.tar.gz | tar -xzC /usr/bin/ && \
|
||||
mkdir -p /src/export-app
|
||||
mkdir -p /src
|
||||
|
||||
COPY rainbond-chaos entrypoint.sh build.pl /run/
|
||||
COPY run.sh /src/export-app/
|
||||
COPY export-app /src/export-app
|
||||
|
||||
WORKDIR $WORK_DIR
|
||||
|
||||
|
@ -15,15 +15,43 @@ iprint(){
|
||||
check::dependency(){
|
||||
which docker &> /dev/null || {
|
||||
eprint 'Not found docker command!'
|
||||
return 11
|
||||
|
||||
install::docker || {
|
||||
eprint 'Failed to install docker!'
|
||||
return 11
|
||||
}
|
||||
|
||||
iprint 'successful install docker!'
|
||||
return 0
|
||||
}
|
||||
|
||||
which docker-compose &> /dev/null || {
|
||||
eprint 'Not found docker-compose command!'
|
||||
return 13
|
||||
|
||||
install::docker-compose || {
|
||||
eprint 'Failed to install docker-compose!'
|
||||
return 13
|
||||
}
|
||||
|
||||
iprint 'successful install docker-compose!'
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
install::docker(){
|
||||
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo &&
|
||||
yum install -y docker-ce &&
|
||||
which docker &>/dev/null &&
|
||||
systemctl start docker &&
|
||||
systemctl enable docker
|
||||
}
|
||||
|
||||
install::docker-compose(){
|
||||
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
which docker-compose &>/dev/null
|
||||
}
|
||||
|
||||
import::image(){
|
||||
find . -name '*.image.tar' | xargs -I LOADIMAGES docker load -i LOADIMAGES
|
||||
}
|
Loading…
Reference in New Issue
Block a user