Docker Setup Error on WSL 2

Hi all,

I’m trying to get this service running on my local machine in order to be able to query an area larger than 50 km2. This is my first time using docker and I’ve run into a couple of roadblocks. Trying to setup the all-in-one-image as that seemed to be the easiest way to simply deal with the size restriction and continue on with my actual project.

I have docker successfully running on Ubuntu 20.04.4 under WSL 2, and have verified this with the docker run hello-world running successfully.

When I initially tried the docker-compose command (docker-compose -f /path/to/docker-compose.yml up api -d) I received an error “No such service -d”. Indeed my docker doesn’t appear to have a -d option listed in the help and so I guess it believes this is a service.

Removing the -d appeared to allow things to get setup, but at the end it throws a syntax error:

ops-db is up-to-date
Starting ops-api … done
Attaching to ops-api
ops-api | line 5: syntax error near unexpected token elif' 'ps-api | line 5: elif [[ ! -z “$INIT_DB” ]]; then
ops-api exited with code 2

Is there something wrong with my docker install? I could really use some guidance here as I’m not in a position to correct the scripts myself. I’m not very familiar with bash scripting.

Hi @rye761
-d is a flag to run the docker-compose process in the background instead of stdout.
probably try ... -d api instead of ...api -d. Thats should be the correct order if you look at the compose docs.

However, in your case you actually want the output directly (instead of looking at the docker logs) i guess, so just leave it.

Not sure how Files behave with WSL but the second thing might have to do with windows file-endings.
But it seems it rather can’t handle spaces there.

Can’t reproduce this right now. Probably also @takb might be able to help.

Best regards

This appeared to be the issue. I originally cloned the repo using Windows git bash before working with it on the Linux side as my linux git didn’t appear to be working, and I think that created the issue. I deleted everything and re-cloned from the linux side and it’s up and running now. Note that I had to delete the image from docker, as simply deleting the container didn’t work. That’s probably evident to someone more familiar with docker but in my case it took a little bit of trial and error to realize.