Skip to content

Commit

Permalink
change docker install source to download.docker.com
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMKuehne committed Dec 13, 2023
1 parent 0181b80 commit 32c5ed4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 33 deletions.
2 changes: 1 addition & 1 deletion dev-tools/check_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ dockerchecker(){
mapfile -t DOCKER_COMPS < <(find . -maxdepth 1 -type d -name migrations -prune -false -o -iname "docker-compose*.yml")
for DOCKER_COMP in "${DOCKER_COMPS[@]}"; do
echo -e "\\n""${GREEN}""Run docker check on ${DOCKER_COMP}:""${NC}""\\n"
if docker-compose -f "${DOCKER_COMP}" config 1>/dev/null || [[ $? -ne 1 ]]; then
if docker compose -f "${DOCKER_COMP}" config 1>/dev/null || [[ $? -ne 1 ]]; then # TODO check
echo -e "${GREEN}""${BOLD}""==> SUCCESS""${NC}""\\n"
else
echo -e "\\n""${ORANGE}${BOLD}==> FIX ERRORS""${NC}""\\n"
Expand Down
4 changes: 2 additions & 2 deletions helper/helper_embark_general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ check_db() {
HOST_ENV=$(grep DATABASE_HOST ./.env | sed 's/DATABASE\_HOST\=//')
echo -e "\\n${ORANGE}""${BOLD}""checking database""${NC}\\n""${BOLD}=================================================================${NC}"
echo -e "${BLUE}""${BOLD}""1. checking startup""${NC}\\n"
if docker-compose -f ./docker-compose.yml up -d ; then
if docker compose -f ./docker-compose.yml up -d ; then
echo -e "${GREEN}""${BOLD}""Finished setup mysql and redis docker images""${NC}"
add_to_env_history "${PW_ENV}" "$(docker-compose ps -q embark_db)"
add_to_env_history "${PW_ENV}" "$(docker compose ps -q embark_db)"
else
echo -e "${ORANGE}""${BOLD}""Failed setup mysql and redis docker images""${NC}"
exit 1
Expand Down
50 changes: 20 additions & 30 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,37 +226,27 @@ install_debs(){
fi
# Gcc
if ! command -v gcc > /dev/null ; then
apt-get install build-essential
apt-get install -y build-essential
fi
# Docker
if [[ "${WSL}" -eq 1 ]]; then
echo -e "\n${ORANGE}WARNING: If you are using WSL2, disable docker integration from the docker-desktop daemon!${NC}"
read -p "Fix docker stuff, then continue. Press any key to continue ..." -n1 -s -r
fi
if ! command -v docker > /dev/null ; then
apt-get install -y docker.io
fi
DOCKER_VER=$(pip3 show docker | grep Version: | awk '{print $2}')
if [[ $(version "${DOCKER_VER}") -ge $(version "7.0.0") ]]; then
echo -e "\n${ORANGE}WARNING: compatibility of the used docker version is unknown!${NC}"
echo -e "\n${ORANGE}Please consider downgrading your pip3 docker version. \$pip3 install \"docker<7.0.0\"${NC}"
read -p "If you know what you are doing you can press any key to continue ..." -n1 -s -r
fi
# docker-compose
if ! command -v docker-compose > /dev/null ; then
pip3 install docker-compose --upgrade || true
if ! [[ -d /usr/bin/docker-compose ]]; then
ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose
fi
else
DOCKER_COMP_VER=$(docker-compose -v | grep version | awk '{print $3}' | tr -d ',')
if [[ $(version "${DOCKER_COMP_VER}") -lt $(version "1.28.5") ]]; then
echo -e "\n${ORANGE}WARNING: compatibility of the used docker-compose version is unknown!${NC}"
echo -e "\n${ORANGE}Please consider updating your docker-compose installation to version 1.28.5 or later.${NC}"
read -p "If you know what you are doing you can press any key to continue ..." -n1 -s -r
fi
if ! command -v docker > /dev/null && ! command -v docker-compose > /dev/null ; then
# Add Docker's official GPG key:
apt-get install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
fi

# python3-dev
if ! dpkg -l python3.10-dev &>/dev/null; then
apt-get install -y python3.10-dev || apt-get install -y -q python3-dev
Expand Down Expand Up @@ -373,13 +363,13 @@ install_embark_default(){
fi

# download images for container
docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d

# activate daemon
systemctl start embark.service
check_db
docker-compose stop
docker compose stop
echo -e "${GREEN}""${BOLD}""Ready to use \$sudo ./run-server.sh ""${NC}"
echo -e "${GREEN}""${BOLD}""Which starts the server on (0.0.0.0) port 80 ""${NC}"
}
Expand Down Expand Up @@ -449,11 +439,11 @@ install_embark_dev(){
chmod 644 .env

# download images for container
docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d

check_db
docker-compose stop
docker compose stop
echo -e "${GREEN}""${BOLD}""Ready to use \$sudo ./dev-tools/debug-server-start.sh""${NC}"
echo -e "${GREEN}""${BOLD}""Or use otherwise""${NC}"
}
Expand Down

0 comments on commit 32c5ed4

Please sign in to comment.