Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker compose check in setup #7609

Merged
merged 5 commits into from
Sep 24, 2024
Merged

fix: docker compose check in setup #7609

merged 5 commits into from
Sep 24, 2024

Conversation

naftis
Copy link
Collaborator

@naftis naftis commented Sep 12, 2024

Problem:

While running setup.sh this kind of problem occurs if you don't have an compose -bin:
image

which handles separate parameters as separate binaries

naf:~/Projects/opencrvs-core$ which docker compose
/snap/bin/docker
/usr/bin/compose

while most machines have this binary, this is not what our setup script refers to.

Solution:

Remove the docker compose check and check separately for docker compose version.

@naftis naftis added this to the v1.5.1 milestone Sep 12, 2024

This comment has been minimized.

@naftis
Copy link
Collaborator Author

naftis commented Sep 13, 2024

Tested via creating an empty Ubuntu container, installing a old Docker, seeing it fails, then installing latest and seeing it passes.

docker run -it ubuntu:20.04
apt update
apt install git-all
8
18
git clone https://github.com/opencrvs/opencrvs-core.git
apt install curl
apt install unzip
curl -fsSL https://fnm.vercel.app/install | bash
source /root/.bashrc
fnm use --install-if-missing 18.20.2
npm install -g yarn
apt install tmux
cd opencrvs-core
git checkout fix-docker-setup

Run setup

bash setup.sh

OpenCRVS thinks docker is not installed.

Installing old docker

apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install docker-ce=5:20.10.0~3-0~ubuntu-focal docker-ce-cli=5:20.10.0~3-0~ubuntu-focal containerd.io

Run setup

bash setup.sh

✅ docker installed! :)
✅ node installed! :)
✅ yarn installed! :)
✅ tmux installed! :)
Docker Compose is not available in your Docker installation
Your Docker version may be too old to include Docker Compose as part of the Docker CLI.
Please follow the installation instructions here: https://docs.docker.com/engine/install/ubuntu/

Remove Docker

sudo apt-get purge -y docker-ce docker-ce-cli docker-ce-rootless-extras containerd.io
docker -v

bash: /usr/bin/docker: No such file or directory

Install latest Docker

apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Run setup

bash setup.sh
...
:::::::: Checking that you have the required dependencies installed ::::::::

✅ docker installed! :)
✅ node installed! :)
✅ yarn installed! :)
✅ tmux installed! :)

:::::: NOW WE NEED TO CHECK THAT YOUR NODE VERSION IS SUPPORTED ::::::

Your Node version: 18.20.2 is supported! :)

:::::::::: Stopping any currently running Docker containers ::::::::::

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

setup.sh: line 299: lsof: command not found
✅ 3447  port is available! :)
setup.sh: line 299: lsof: command not found

---> It passed through the Docker test.

@naftis naftis modified the milestones: v1.5.1, v1.6.0 Sep 13, 2024
@AshwinMN24
Copy link

The changes looks good.

@ocrvs-bot
Copy link
Collaborator

Your environment is deployed to https://fix-docker-setup.opencrvs.dev.

@naftis naftis merged commit 41a0d29 into develop Sep 24, 2024
37 of 39 checks passed
@naftis naftis deleted the fix-docker-setup branch September 24, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants