Development setup with Docker: errors

I just tried to get Foodsoft running locally via Docker (Ubuntu) and ran into the following problems:

  • docker-compose -f docker-compose-dev.yml up -d mariadb
    led to the error docker.errors.DockerException: Install paramiko package to enable ssh:// support
    I noticed that this is a problem with compose v1 (I was using docker-compose version 1.29.2) and tried compose v2, replacing “docker-compose” with “docker compose”. Then the first command worked.
  • docker compose -f docker-compose-dev.yml run --rm foodsoft bundle install
    Again using compose v2, I got the following error:
    Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./docker-entrypoint.sh": stat ./docker-entrypoint.sh: no such file or directory: unknown
    I was using shell in the Foodsoft directory.
    How should I solve this?

Tested with docker-compose 1.29.2 I have no such problems on Debian bullseye.

Maybe it’s to obvious: does docker-entrypoint.sh exists in the same path you’re running docker-compose?

Yes, as I wrote I was running it in the Foodsoft path where the docker-entrypoint.sh was as well.
But note: I did not run docker-compose but docker compose (v2) because of the problem I mentioned above.

did the docker context stuff we’ve talked about work you? :slight_smile:
making docker-compose v2 work could be another issue for the tracker …

I tried to install Foodsoft via Docker on Windows 10 now since using Linux is too inconvenient for me. I followed the setup instructions for docker but came along some issues, probably because I have docker compose v2.24.3-desktop.1 installed. I don’t want to replace it with the out-of-date docker-compose v1 (you would you solve this? environments?) so I tried to find a solution with v2:

docker-compose -f docker-compose-dev.yml run --rm foodsoft \
  bundle install

lead to the error:

exec ./docker-entrypoint.sh: no such file or directory

In the compose v2 docs I found the tip to use --compatibilty, so I ran:

docker compose --compatibility -f docker-compose-dev.yml run --rm foodsoft bundle install

Now it seemed to work. Same for the following command (setup_development_docker).

Then I ran:

docker compose --compatibility -f docker-compose-dev.yml up

and came across the error:

foodsoft_worker_1   | ./docker-entrypoint.sh: 26: exec: ./proc-start: not found

The docker-entrypoint.sh file definitely exists in the root folder.

What would you suggest?

Thanks for your the list of things you tried, good to know it doesn’t work anymore with Docker Desktop. It seems the worker container cannot find the file proc-start (but it can file docker-entrypoint.sh). That is a little odd.

You might try replacing ./proc-start worker with QUEUE=* bundle exec rake resque:work (or even move the QUEUE setting to the env section) in docker-compose-dev.yml - just as something to try.

An alternative approach is to install the docker daemon in WSL2, then you don’t need Docker Desktop (e.g. with this guide). But eventually I think it would be useful to have Foodsoft working out of the box with Docker Desktop as well.

There seems to be a number of small but perhaps relevant differences migrating from docker compose 1 to 2 (same link you mentioned), including in the behaviour of environment variables. But that does not seem to be the issue you experience.

It’s really odd that the entry point can be found, but proc-start not.

This gives me:

foodsoft_worker_1   | ./docker-entrypoint.sh: 26: exec: QUEUE=*: not found
[...]
foodsoft_worker_1 exited with code 127

and:

foodsoft_1          | ./docker-entrypoint.sh: 26: exec: ./proc-start: not found
[...]
foodsoft_1 exited with code 127

(perhaps I overlooked this second hint earlier)

btw when I try to run the container from the Docker Desktop GUI, I get:

(HTTP code 400) unexpected - failed to create task for container: 
failed to create shim task: OCI runtime create failed: runc create failed: 
unable to start container process: exec: "./docker-entrypoint.sh": 
stat ./docker-entrypoint.sh: no such file or directory: unknown

Ok but I still might need to switch to compose v1 and that’s a problem since I might need v2 in WSL for another project. How do you solve this? Is it possible to have both at the same time? Or by using a virtual environment?

I tried it with WSL2 now (without Docker) and failed here:

foodsoft$ rbenv exec rails foodsoft:setup_development
rbenv: rails: command not found

Minor notes up to that point:

This sounds like you’d need to have these installed for the next steps, however, the following steps include the installation of them.

This line should be updated, since I got:

Fetching bundler-2.5.5.gem
ERROR:  Error installing bundler:
        The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.4.22. Try installing it with `gem install bundler -v 2.4.22`
        bundler requires Ruby version >= 3.0.0. The current ruby version is 2.7.8.225.

btw I forgot that I don’t need Docker if I use WSL in the first place. Also I found this tutorial in case I should need WSL with a different Ruby version for example (perhaps someone might need this)

Update: @lentschi helped me and it’s working now on my computer via Windows/Docker, both for upstream as for our hackathon fork.

The main issue seems to be that I hadn’t understood what a “clean checkout” (Windows prerequisite) was. I assumed it meant something with git checkout, while it means you have to clone the repo after that command. I’d suggest to update this terminology in the instructions to make it more beginner-friendly.

Docker compose (v2) is supported! Only the instructions still assume that you’re using v1. I’d suggest changing the instructions to the v2 command (docker compose instead of docker-compose) and either adding a note for v1 users or legacy instructions, since it’s tedious and confusing to always having to replace the - with a space. (of course, the requirements have to be updated as well)

@yksflip We’ve come across a bug with the seeds and active record which I described in an issue.

1 Like