diff --git a/.dappnode_profile b/.dappnode_profile index b89efb7..de68115 100755 --- a/.dappnode_profile +++ b/.dappnode_profile @@ -18,11 +18,11 @@ DNCORE_YMLS=$(find $DAPPNODE_CORE_DIR -name "docker-compose-*.yml" -printf "-f % DNCORE_YMLS_ARRAY=($(find /usr/src/dappnode/DNCORE -name "docker-compose-*.yml" | sort)) # Returns docker core containers status -alias dappnode_status='docker-compose $DNCORE_YMLS ps' +alias dappnode_status='docker compose $DNCORE_YMLS ps' # Stop docker core containers -alias dappnode_stop='docker-compose $DNCORE_YMLS stop && docker stop $(docker container ls -a -q -f name=DAppNode*)' +alias dappnode_stop='docker compose $DNCORE_YMLS stop && docker stop $(docker container ls -a -q -f name=DAppNode*)' # Start docker core containers -alias dappnode_start='docker-compose $DNCORE_YMLS up -d && docker start $(docker container ls -a -q -f name=DAppNode*)' +alias dappnode_start='docker compose $DNCORE_YMLS up -d && docker start $(docker container ls -a -q -f name=DAppNode*)' # Return open-vpn credentials from a specific user. e.g: dappnode_get dappnode_admin alias dappnode_openvpn_get='docker exec -i DAppNodeCore-vpn.dnp.dappnode.eth vpncli get' # Return open-vpn admin credentials diff --git a/README.md b/README.md index 9f8382c..12c5e32 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,8 @@ Install DAppNode on your host machine by burning DAppNode ISO to a DVD or creati ```bash git clone https://github.com/dappnode/DAppNode.git cd DAppNode -docker-compose build -docker-compose up +docker compose build +docker compose up ``` DAppNode iso will be generated inside images folder, to verify it: diff --git a/docker-compose.yml b/docker-compose.yml index 7eddc98..cee7620 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: environment: - BUILD=false # In case you want to re-generate a all the images, not recommended - CLEAN=true # it remove the images directory - - UNATTENDED=false # UNATTENDED version + - UNATTENDED=true # UNATTENDED version volumes: - ./images:/images - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/iso/scripts/generate_docker_images.sh b/iso/scripts/generate_docker_images.sh index 8ca5636..bac8c9a 100755 --- a/iso/scripts/generate_docker_images.sh +++ b/iso/scripts/generate_docker_images.sh @@ -12,42 +12,42 @@ echo "Downloading source code & building DNP_WIREGUARD..." curl -LJO https://github.com/dappnode/DNP_WIREGUARD/archive/refs/tags/"v${WIREGUARD_VERSION}.tar.gz" || { echo "Failed to download DNP_WIREGUARD"; exit 1; } mkdir DNP_WIREGUARD tar -xzf "DNP_WIREGUARD-${WIREGUARD_VERSION}.tar.gz" -C ./DNP_WIREGUARD --strip-components=1 || { echo "Failed to extract DNP_WIREGUARD"; exit 1; } -docker-compose -f ./DNP_WIREGUARD/docker-compose.yml build || { echo "Failed to build DNP_WIREGUARD"; exit 1; } +docker compose -f ./DNP_WIREGUARD/docker-compose.yml build || { echo "Failed to build DNP_WIREGUARD"; exit 1; } docker save wireguard.dnp.dappnode.eth:"${WIREGUARD_VERSION}" | xz -e9vT0 >/images/wireguard.dnp.dappnode.eth_"${WIREGUARD_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_WIREGUARD"; exit 1; } echo "Downloading source code & building DNP_HTTPS..." curl -LJO https://github.com/dappnode/DNP_HTTPS/archive/refs/tags/"v${HTTPS_VERSION}.tar.gz" || { echo "Failed to download DNP_HTTPS"; exit 1; } mkdir DNP_HTTPS tar -xzf "DNP_HTTPS-${HTTPS_VERSION}.tar.gz" -C ./DNP_HTTPS --strip-components=1 || { echo "Failed to extract DNP_HTTPS"; exit 1; } -docker-compose -f ./DNP_HTTPS/docker-compose.yml build || { echo "Failed to build DNP_HTTPS"; exit 1; } +docker compose -f ./DNP_HTTPS/docker-compose.yml build || { echo "Failed to build DNP_HTTPS"; exit 1; } docker save https.dnp.dappnode.eth: "${HTTPS_VERSION}" | xz -e9vT0 >/images/https.dnp.dappnode.eth_"${HTTPS_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_HTTPS"; exit 1; } echo "Downloading source code & building DNP_IPFS..." curl -LJO https://github.com/dappnode/DNP_IPFS/archive/refs/tags/"v${IPFS_VERSION}.tar.gz" || { echo "Failed to download DNP_IPFS"; exit 1; } mkdir DNP_IPFS tar -xzf "DNP_IPFS-${IPFS_VERSION}.tar.gz" -C ./DNP_IPFS --strip-components=1 || { echo "Failed to extract DNP_IPFS"; exit 1; } -docker-compose -f ./DNP_IPFS/docker-compose.yml build || { echo "Failed to build DNP_IPFS"; exit 1; } +docker compose -f ./DNP_IPFS/docker-compose.yml build || { echo "Failed to build DNP_IPFS"; exit 1; } docker save ipfs.dnp.dappnode.eth:"${IPFS_VERSION}" | xz -e9vT0 >/images/ipfs.dnp.dappnode.eth_"${IPFS_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_IPFS"; exit 1; } echo "Downloading source code & building DNP_BIND..." curl -LJO https://github.com/dappnode/DNP_BIND/archive/refs/tags/"v${BIND_VERSION}.tar.gz" || { echo "Failed to download DNP_BIND"; exit 1; } mkdir DNP_BIND tar -xzf "DNP_BIND-${BIND_VERSION}.tar.gz" -C ./DNP_BIND --strip-components=1 || { echo "Failed to extract DNP_BIND"; exit 1; } -docker-compose -f ./DNP_BIND/docker-compose.yml build || { echo "Failed to build DNP_BIND"; exit 1; } +docker compose -f ./DNP_BIND/docker-compose.yml build || { echo "Failed to build DNP_BIND"; exit 1; } docker save bind.dnp.dappnode.eth:"${BIND_VERSION}" | xz -e9vT0 >/images/bind.dnp.dappnode.eth_"${BIND_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_BIND"; exit 1; } echo "Downloading source code & building DNP_DAPPMANAGER..." curl -LJO https://github.com/dappnode/DNP_DAPPMANAGER/archive/refs/tags/"v${DAPPMANAGER_VERSION}.tar.gz" || { echo "Failed to download DNP_DAPPMANAGER"; exit 1; } mkdir DNP_DAPPMANAGER tar -xzf "DNP_DAPPMANAGER-${DAPPMANAGER_VERSION}.tar.gz" -C ./DNP_DAPPMANAGER --strip-components=1 || { echo "Failed to extract DNP_DAPPMANAGER"; exit 1; } -docker-compose -f ./DNP_DAPPMANAGER/docker-compose.yml build || { echo "Failed to build DNP_DAPPMANAGER"; exit 1; } +docker compose -f ./DNP_DAPPMANAGER/docker-compose.yml build || { echo "Failed to build DNP_DAPPMANAGER"; exit 1; } docker save dappmanager.dnp.dappnode.eth:"${DAPPMANAGER_VERSION}" | xz -e9vT0 >/images/dappmanager.dnp.dappnode.eth_"${DAPPMANAGER_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_DAPPMANAGER"; exit 1; } echo "Downloading source code & building DNP_WIFI..." curl -LJO https://github.com/dappnode/DNP_WIFI/archive/refs/tags/"v${WIFI_VERSION}.tar.gz" || { echo "Failed to download DNP_WIFI"; exit 1; } mkdir DNP_WIFI tar -xzf "DNP_WIFI-${WIFI_VERSION}.tar.gz" -C ./DNP_WIFI --strip-components=1 || { echo "Failed to extract DNP_WIFI"; exit 1; } -docker-compose -f ./DNP_WIFI/docker-compose.yml build || { echo "Failed to build DNP_WIFI"; exit 1; } +docker compose -f ./DNP_WIFI/docker-compose.yml build || { echo "Failed to build DNP_WIFI"; exit 1; } docker save wifi.dnp.dappnode.eth:"${WIFI_VERSION}" | xz -e9vT0 >/images/wifi.dnp.dappnode.eth_"${WIFI_VERSION}"_linux-amd64.txz || { echo "Failed to save DNP_WIFI"; exit 1; } echo "Coping dappnode_all_docker_images_linux-amd64.txz to dappnode dir..." diff --git a/scripts/dappnode_install.sh b/scripts/dappnode_install.sh index b8deb8e..4a556f5 100755 --- a/scripts/dappnode_install.sh +++ b/scripts/dappnode_install.sh @@ -146,7 +146,7 @@ dappnode_core_build() { # Change version in YAML to the custom one DOCKER_VER=$(echo "${!ver##*:}" | sed 's/\//_/g') sed -i "s~^\(\s*image\s*:\s*\).*~\1${comp,,}.dnp.dappnode.eth:${DOCKER_VER}~" DNP_"${comp}"/docker-compose.yml - docker-compose -f ./DNP_"${comp}"/docker-compose.yml build + docker compose -f ./DNP_"${comp}"/docker-compose.yml build cp ./DNP_"${comp}"/docker-compose.yml "${DAPPNODE_CORE_DIR}"/docker-compose-"${comp,,}".yml cp ./DNP_"${comp}"/dappnode_package.json "${DAPPNODE_CORE_DIR}"/dappnode_package-"${comp,,}".json rm -r ./DNP_"${comp}" @@ -225,7 +225,7 @@ dappnode_start() { # Execute `compose-up` independently # To execute `compose-up` against more than 1 compose, composes files must share compose file version (e.g 3.5) for comp in "${DNCORE_YMLS_ARRAY[@]}"; do - docker-compose -f "$comp" up -d 2>&1 | tee -a $LOGFILE + docker compose -f "$comp" up -d 2>&1 | tee -a $LOGFILE echo "${comp} started" 2>&1 | tee -a $LOGFILE done echo -e "\e[32mDAppNode started\e[0m" 2>&1 | tee -a $LOGFILE diff --git a/scripts/dappnode_install_pre.sh b/scripts/dappnode_install_pre.sh index 96654f9..d2c1517 100755 --- a/scripts/dappnode_install_pre.sh +++ b/scripts/dappnode_install_pre.sh @@ -34,7 +34,7 @@ add_docker_repo() { # DOCKER INSTALLATION install_docker() { apt-get update -y - apt-get install -y docker-ce docker-ce-cli containerd.io | tee -a $LOG_FILE + apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | tee -a $LOG_FILE # Ensure xz is installed [ -f "/usr/bin/xz" ] || ( apt-get install -y xz-utils) @@ -54,20 +54,13 @@ install_docker() { fi } -# DOCKER COMPOSE INSTALLATION -install_docker_compose() { - apt-get install -y docker-compose | tee -a $LOG_FILE - - # Disable check if ISO installation since it is not possible to check in this way - if [ "$ISO_INSTALLATION" = "false" ]; then - # Validate the installation of docker-compose - if docker-compose -v; then - echo -e "\e[32m \n\n Verified docker-compose installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE - else - echo -e "\e[31m \n\n ERROR: docker-compose is not installed \n\n Please re-install it \n\n \e[0m" 2>&1 | tee -a $LOG_FILE - exit 1 - fi - fi +# DOCKER-COMPOSE FOR LEGACY SCRIPTS, SHOULD BE REMOVED EVENTUALLY +alias_docker_compose() { + cat > /usr/local/bin/docker-compose</dev/null 2>&1; then - echo -e "\e[32m \n\n docker-compose is already installed \n\n \e[0m" 2>&1 | tee -a $LOG_FILE + echo -e "\e[32m \n\n docker-compose is already aliased \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else - install_docker_compose 2>&1 | tee -a $LOG_FILE + alias_docker_compose 2>&1 | tee -a $LOG_FILE fi # Only install wireguard-dkms if needed diff --git a/scripts/dappnode_test_install.sh b/scripts/dappnode_test_install.sh index b91fe92..4d5d704 100755 --- a/scripts/dappnode_test_install.sh +++ b/scripts/dappnode_test_install.sh @@ -36,8 +36,8 @@ else error_exit fi -if docker-compose -v >/dev/null 2>&1; then - echo -e "\e[32m docker-compose installed ok\e[0m" +if docker compose -v >/dev/null 2>&1; then + echo -e "\e[32m docker compose installed ok\e[0m" else error_exit fi