hyku
hyku copied to clipboard
Docker containers unsuccessful due to old Ruby version in base image
Descriptive summary
I'm attempting to run the docker containers locally on my machine. I followed the directions in the readme and after running docker compose up web
the initialize_app
service logs in Docker Desktop showed this error, which due to the dependencies preventing the rest of the containers from spinning up.
hyrax-5.0.0.rc2 requires ruby version >= 3.2, which is incompatible with the current version, 2.7.7
Rationale
The documentation states that Ruby 2.7 is recommended, but if a later version is needed, then this and any troubleshooting steps should be addressed in documentation.
Expected behavior
Docker containers should spin up after running docker compose up web
Actual behavior
initialize-app
docker service fails to start due to an error message about requiring ruby >=3.2
Steps to reproduce the behavior
- run
ruby -v
to verify your version. Mine was3.3.0
- Clone the repo
- Ensure Docker Desktop is downloaded, installed and running.
-
cd
into the repo - run
gem install dory
anddory up
thendocker compose up web
- As long as you don't run in detached mode, you should see the error below, and if you inspect the docker logs for the
initialize_app
service you should see the error message above.
service "initialize_app" didn't complete successfully: exit 5` and
Additional info
The 2.7.7 ruby version comes from the ghcr.io/samvera/hyku/base:latest
image. I used ruby -v
inside that image to find that.
- Run
docker run -it ghcr.io/samvera/hyku/base:latest /bin/bash
- While in the docker exec mode, run
ruby -v
to verify version 2.7.7
In addition, if you open the inspector for the initialize-app
docker service, you'll see these lines:
"RUBY_MAJOR=2.7", "RUBY_VERSION=2.7.7", "RUBY_DOWNLOAD_SHA256=b38dff2e1f8ce6e5b7d433f8758752987a6b2adfd9bc7571dbc42ea5d04e3e4c",
and the ghcr.io/samvera/hyku/base:latest
image has Ruby 2.7 set in the layers
I'd be happy to work on a first PR to fix this, but was wondering if anyone could point me in the right direction.
We're in the process of working through Ruby, Rails, and Hyrax versions.
It also sounds like you might be running against main
; Consider running against v5.1.0
. The main
branch is not considered stable.
Thanks @jeremyf !
Wasn't sure if this should be posted as an issue or just a support question. I checked out the v5.1.0 tag, and successfully spun up the web docker service. I entered a repo name and the browser is requesting a login. I tried [email protected]
and testing123
as found in the environment variables, and I tried various *@example.com
but none of them work. Anything I'm missing?
Edit: Found it in app/controllers/application_controller.rb
username: samvera
passwordhyku
# Extra authentication for palni-palci during development phase
def authenticate_if_needed
# Disable this extra authentication in test mode
return true if Rails.env.test?
if (is_hidden || is_staging) && !is_api_or_pdf
authenticate_or_request_with_http_basic do |username, password|
username == "samvera" && password == "hyku"
end
end
end
I'll add a PR to clarify this in the README