docker 2.0 compatibility

This commit is contained in:
2023-11-06 21:09:12 +01:00
parent e0ae154b71
commit 2effa4496c
5 changed files with 8 additions and 19 deletions

3
.gitignore vendored
View File

@@ -2,4 +2,5 @@
.vscode .vscode
dist/** dist/**
!dist/setup.sh !dist/setup.sh
!dist/sr.sh !dist/sr.sh
.history

View File

@@ -41,7 +41,7 @@ start_apps() {
if [ "$DOCKER_MODE" = "swarm" ]; then if [ "$DOCKER_MODE" = "swarm" ]; then
docker stack deploy -c $APP_SCRIPT_PATH/docker-compose.yaml $APP_ID docker stack deploy -c $APP_SCRIPT_PATH/docker-compose.yaml $APP_ID
elif [ "$DOCKER_MODE" = "compose" ]; then elif [ "$DOCKER_MODE" = "compose" ]; then
docker-compose -p $APP_ID -f $APP_SCRIPT_PATH/docker-compose.yaml up -d --remove-orphans docker compose -p $APP_ID -f $APP_SCRIPT_PATH/docker-compose.yaml up -d --remove-orphans
fi fi
fi fi
fi fi
@@ -66,7 +66,7 @@ docker run --rm -v cyphernode_container_monitor:/container_monitor alpine sh -c
<% if (docker_mode == 'swarm') { %> <% if (docker_mode == 'swarm') { %>
docker stack deploy -c $current_path/docker-compose.yaml cyphernode docker stack deploy -c $current_path/docker-compose.yaml cyphernode
<% } else if(docker_mode == 'compose') { %> <% } else if(docker_mode == 'compose') { %>
docker-compose -p cyphernode -f $current_path/docker-compose.yaml up -d --remove-orphans docker compose -p cyphernode -f $current_path/docker-compose.yaml up -d --remove-orphans
<% } %> <% } %>
start_apps start_apps

View File

@@ -37,7 +37,7 @@ stop_apps() {
if [ "$DOCKER_MODE" = "swarm" ]; then if [ "$DOCKER_MODE" = "swarm" ]; then
docker stack rm $APP_ID docker stack rm $APP_ID
elif [ "$DOCKER_MODE" = "compose" ]; then elif [ "$DOCKER_MODE" = "compose" ]; then
docker-compose -p $APP_ID -f $APP_SCRIPT_PATH/docker-compose.yaml down docker compose -p $APP_ID -f $APP_SCRIPT_PATH/docker-compose.yaml down
fi fi
fi fi
@@ -53,5 +53,5 @@ export USER=$(id -u):$(id -g)
<% if (docker_mode == 'swarm') { %> <% if (docker_mode == 'swarm') { %>
docker stack rm cyphernode docker stack rm cyphernode
<% } else if(docker_mode == 'compose') { %> <% } else if(docker_mode == 'compose') { %>
docker-compose -p cyphernode -f ${current_path}/docker-compose.yaml down docker compose -p cyphernode -f ${current_path}/docker-compose.yaml down
<% } %> <% } %>

14
dist/setup.sh vendored
View File

@@ -721,13 +721,6 @@ check_docker() {
fi fi
} }
check_docker_compose() {
if ! [ -x "$(command -v docker-compose)" ]; then
echo " docker-compose is not installed on your system. Please check https://docs.docker.com/compose/install/."
exit
fi
}
sanity_checks_pre_config() { sanity_checks_pre_config() {
echo " check requirements for configuration step." echo " check requirements for configuration step."
check_docker check_docker
@@ -737,11 +730,6 @@ sanity_checks_pre_install() {
echo " check requirements for installation step." echo " check requirements for installation step."
check_docker
if [[ $DOCKER_MODE == 'compose' ]]; then
check_docker_compose
fi
local OS=$(uname -s) local OS=$(uname -s)
if [[ ''$RUN_AS_USER == '' ]]; then if [[ ''$RUN_AS_USER == '' ]]; then
@@ -802,7 +790,7 @@ sanity_checks_pre_install() {
install_apps() { install_apps() {
if [ ! -d "$current_path/apps" ]; then if [ ! -d "$current_path/apps" ]; then
local user=$(id -u $RUN_AS_USER):$(id -g $RUN_AS_USER) local user=$(id -u $RUN_AS_USER):$(id -g $RUN_AS_USER)
local apps_repo="https://github.com/SatoshiPortal/cypherapps.git" local apps_repo="https://github.com/aljazceru/cypherapps.git"
echo " clone $apps_repo into apps" echo " clone $apps_repo into apps"
docker run --rm -v "$current_path":/git --entrypoint sh cyphernode/cyphernodeconf:$CONF_VERSION -c "git clone --single-branch -b ${CYPHERAPPS_VERSION} \"$apps_repo\" /git/apps > /dev/null 2>&1 ; chown -R $user /git/apps" docker run --rm -v "$current_path":/git --entrypoint sh cyphernode/cyphernodeconf:$CONF_VERSION -c "git clone --single-branch -b ${CYPHERAPPS_VERSION} \"$apps_repo\" /git/apps > /dev/null 2>&1 ; chown -R $user /git/apps"
fi fi

2
dist/sr.sh vendored
View File

@@ -1 +1 @@
curl -fsSL https://raw.githubusercontent.com/SatoshiPortal/cyphernode/master/dist/setup.sh -o setup_cyphernode.sh && chmod +x setup_cyphernode.sh && ./setup_cyphernode.sh curl -fsSL https://raw.githubusercontent.com/aljaz/cyphernode/master/dist/setup.sh -o setup_cyphernode.sh && chmod +x setup_cyphernode.sh && ./setup_cyphernode.sh