Hello everyone I am trying to locally setup the project in windows WSL +docker i have now set up the cht-layout project (dev container) (ig this this a temple of a real application) . After that what i understood from the ( App Developer Hosting in CHT 4.x | Community Health Toolkit) that I have:
to clone the cht-core repo and run the docker command ./cht-docker-compose.sh (in the dev conainer ?)
but facing this error can some one please help me guide what i need to do to resolve this
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core/scripts$ cd ..
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core$ ./cht-docker-compose.sh up -d
bash: ./cht-docker-compose.sh: No such file or directory
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core$ ///
hi @Shubhank - thanks so much for your question and welcome to the forum! This is exactly the right place to ask your question. Let’s try and solve your issue!
It looks like your WSL2 VM has the CHT Core repo cloned, but let’s be sure you’re up to date first. I’m assuming that /workspaces/cht-project/cht-core/cht-core is where the CHT Core repo is cloned to. To update it:
launch your wsl2 terminal
Change directories into the CHT Core: cd /workspaces/cht-project/cht-core/cht-core
Tell git to fetch and meta data and then to pull down any updates: git fetch ; git pull origin
Report back if you get an errors from that. It’s best if you can copy and past from the WSL2 terminal instead of taking a screenshot. Here’s what it looked like for me as user mrjones on my WSL2 host named wsl2 with a directory structure that matches yours:
mrjones@wsl2:~$ cd /workspaces/cht-project/cht-core/cht-core/ mrjones@wsl2:/workspaces/cht-project/cht-core/cht-core$ git fetch ; git pull origin Already up to date.
Now that we’re sure the code is up to date, let’s see if you can run the Docker Helper:
launch your wsl2 terminal
Change directories into the CHT Core’s Docker Helper directory: cd cd /workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x/
If everything is working, and you have docker desktop already installed, you should see it start to download the upgrade service container:
mrjones@wsl2:~$ cd /workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x/
mrjones@wsl2:/workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x$ ./cht-docker-compose.sh
No project found, follow the prompts to create a project .env file.
Would you like to initialize a new project [y/N]? y
Do you want to run the latest CHT Core version (4.18.0) [Y/n]?
How do you want to name the project? first post FTW
Downloading compose files ... done
homedir: /home/mrjones/.medic/cht-docker/first_post_ftw-dir
[+] Running 5/8
⠙ cht-upgrade-service [⣿⣿⣤⣤⣿⣿⣿] 73.93MB / 127.5MB Pulling 13.1s ✔
And then, depending on the speed of your computer and your internet connection, you should eventually get the URL of your local CHT instance:
--------------------------------------------------------
Success! "first_post_ftw" is set up:
https://172-24-54-83.local-ip.medicmobile.org:10443/ (CHT)
https://172-24-54-83.local-ip.medicmobile.org:10443/_utils (Fauxton)
Login: medic
Password: password
--------------------------------------------------------
Start existing project
./cht-docker-compose.sh ENV-FILE.env
Stop and keep project:
./cht-docker-compose.sh ENV-FILE.env stop
Stop and destroy all project data:
./cht-docker-compose.sh ENV-FILE.env destroy
https://docs.communityhealthtoolkit.org/hosting/4.x/app-developer/
Have a great day!
Here is a screen shot showing:
upper left side: the WSL2 terminal having run the Docker Helper and showing the URL
right site: Docker Desktop in Windows showing all the CHT services running
lower left side: a browser showing the CHT login being served from my local instance
Thank you very much for such detailed explanation what I understood I need to navigate to exact location to run command but now I ran into issue that I dont have docker
Hi @mrjones sorry for bugging you again but I still can’t set up the repo like i i have the dev container up running and i have selected the wsl 2 engine in docker still when i run the command inside the container its says:
bash node@bfb150a064ec:/workspaces/cht-project$ docker ps
bash: docker: command not found
Can you tell me what I need to learn or do to resolve such an issue?
oh thank you this is WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.5189 version I’m using
this is how my .devcontainer file looks like rn I have modified it a bit {
“name”: “CHT Dev”,
“image”: “medicmobile/cht-app-ide:latest”,
// Required for Puppeteer (browser automation in testing)
“capAdd”: [“SYS_ADMIN”],
// Allow the DevContainer to use host Docker
“mounts”: [
“source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind”
]
// (Optional but recommended) Install VS Code extensions
}
Thanks for the info @Shubhank . Since there’s a newer release of WSL2 AND you’re having issues with your release, I think it’d be good to re-install WSL2.
I found a great guide online which I’ve copied here with just the parts you need:
In powershell (as admin)
# list all installed distros
wsl -l -v
# destroy distros listed above - you likely just have Ubuntu
wsl --unregister Ubuntu
wsl --unregister Debian # and so on
In Settings > Apps > Apps & Features
search for Ubuntu (then Debian, etc), and if something is found, click on uninstall
search for Linux, and if something is found, click on uninstall on all results
In Start Menu > Turn Windows Features on or off
Untick Virtual Machine Platform checkbox
Untick Windows Subsystem for Linux checkbox
Reboot
Installing wsl - In powershell (as admin)
# install wsl
wsl --install
Reboot and wait for the Ubundu installation to complete and ask for username (it might takes some time).
Hey @Shubhank it will be much easier to work with GitHub codespaces setting up this project, it offers reasonable amount of time even for free users, just setup a github codespace for this project and follow this LOCAL SETUP.
Thank you @binod but I guess I have my docker desktop up and running this is what i get when i do docker ps in command prompt
C:\Users\Shubhank>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bfb150a064ec medicmobile/cht-app-ide:latest "/bin/sh -c 'echo Co…" 5 days ago Up 12 hours vibrant_leakey
@apoorvapendse - yay - so glad to hear you’re unblocked! Thanks for posting great follow up message summarizing the tips you followed. Very much appreciated!