feat: optimize dockerfile option

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-21 12:11:21 +08:00
parent 3599d4b7ef
commit b02d65bf9a
6 changed files with 147 additions and 151 deletions
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Common utilities, variables and checks for all build scripts.
set -o errexit
set -o nounset
set -o pipefail
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/lib/init.sh"
trap 'openim::util::onCtrlC' INT
chmod +x ${OPENIM_ROOT}/scripts/*.sh
${OPENIM_ROOT}/scripts/init-config.sh
openim::util::ensure_docker_daemon_connectivity
DOCKER_COMPOSE_COMMAND=
# Check if docker-compose command is available
if command -v docker-compose &> /dev/null
then
openim::log::info "docker-compose command is available"
DOCKER_COMPOSE_COMMAND="docker-compose"
else
DOCKER_COMPOSE_COMMAND="docker compose"
fi
pushd "${OPENIM_ROOT}" >/dev/null
${DOCKER_COMPOSE_COMMAND} up -d
sleep 60
${DOCKER_COMPOSE_COMMAND} ps
${DOCKER_COMPOSE_COMMAND} logs
popd >/dev/null
+1 -1
View File
@@ -97,4 +97,4 @@ docker run -d \
-e MINIO_ROOT_USER=${USER} \
-e MINIO_ROOT_PASSWORD=${PASSWORD} \
--restart always \
minio/minio server /data --console-address ':9090'
minio/minio server /data --console-address ':9090'
-3
View File
@@ -973,9 +973,6 @@ function openim::util::ensure-cfssl {
popd > /dev/null || return 1
}
# openim::util::ensure-docker-buildx
# Check if we have "docker buildx" commands available
#
function openim::util::ensure-docker-buildx {
# podman returns 0 on `docker buildx version`, docker on `docker buildx`. One of them must succeed.
if docker buildx version >/dev/null 2>&1 || docker buildx >/dev/null 2>&1; then