code4romania / consul

Consul - Open Government and E-Participation Web Software
https://consulproject.org
GNU Affero General Public License v3.0
0 stars 4 forks source link

Docker build failure on windows with docker #66

Open petre-enciu opened 7 months ago

petre-enciu commented 7 months ago

I tried to build the project with docker compose for windows, following the steps described in the README file. First, there is a problem with some files:

  1. README file: git clone https://github.com/consul/consul.git. it should be git clone https://github.com/code4romania/consul.git
  2. docker-compose.yml - there is no ports binding for the database service. ports statement should be added, ex: ports:
    • "5432:5432"

At the build phase:

  1. docker-compose build gives this error: **_=> ERROR [app 13/16] RUN gem install bundler 28.4s

    [app 13/16] RUN gem install bundler: 28.03 ERROR: Error installing bundler: 28.03 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
    28.03 bundler requires Ruby version >= 3.0.0. The current ruby version is 2.6.7.197.

    failed to solve: process "/bin/sh -c gem install bundler" did not complete successfully: exit code: 1_**

As workaround, I have manually added the bundler version in Dockerfile (line 38): RUN gem install bundler -v 2.4.22 The build works as it should.

  1. docker-compose up gives this error: [+] Running 15/1 ✔ database 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 27.8s [+] Running 3/3 ✔ Network consul_default Created 0.3s ✔ Container consul-database-1 Created 2.3s ✔ Container consul-app-1 Created 0.4s Attaching to app-1, database-1 database-1 | database-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization database-1 | database-1 | LOG: database system was shut down at 2024-03-25 15:53:43 UTC database-1 | LOG: MultiXact member wraparound protections are now enabled database-1 | LOG: database system is ready to accept connections database-1 | LOG: autovacuum launcher started app-1 | /bin/sh: 0: Illegal option - app-1 exited with code 2

In docker-desktop the database container is running, but the container associated with the rails server is always down and cannot be stared.

Please Help!

image

javierm commented 7 months ago

Just for your interest, in the original Consul Democracy repository, this line has been removed because it isn't necessary with Ruby 2.6 and later: https://github.com/consuldemocracy/consuldemocracy/commit/f087d6f1ea.