Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image build fails #4479

Closed
johnpitchko opened this issue Jul 31, 2022 · 12 comments
Closed

Docker image build fails #4479

johnpitchko opened this issue Jul 31, 2022 · 12 comments

Comments

@johnpitchko
Copy link
Contributor

Building the Docker app image fails. Some basic Googling indicates that the Debian image no longer offers the MySQL package.

Solidus Version:

To Reproduce

  1. Clone repo
  2. Build Docker image with docker compose build or docker-compose up -d as stated in README.md

Current behavior

Docker image build fails.

Expected behavior

Docker image build succeeds.

Screenshots

image

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS 12.4
  • Browser [e.g. chrome, safari] Firefox
  • Version [e.g. 22] 102.0.1

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

@gsmendoza
Copy link
Contributor

Hi @johnpitchko . I wasn't able to confirm this on my Pop!_OS 22.04 LTS machine. I deleted all my Docker resources by running docker system prune -a (overkill, in hindsight :P) and then reran docker-compose build on the solidus repo. I didn't encounter any issues with the MySQL installation.

@waiting-for-dev Are you encountering the same issue as @johnpitchko ?

@waiting-for-dev
Copy link
Contributor

@waiting-for-dev Are you encountering the same issue as @johnpitchko ?

I also removed cached images and I didn't find the problem so far 🤔

@RyanofWoods
Copy link
Contributor

This change was needed for my end. 👍

However, I still am getting other errors, but they are related to me using an M1 MacBook and I am still working through this 👀

@johnpitchko
Copy link
Contributor Author

I suppose I should have mentioned; like @RyanofWoods I too am building this on an 2021 M1 MacBook Pro, so that might have something to do with it.

I created a clean fork of the repo and attempted to build the app container (docker compose build --build-arg RUBY_VERSION=2.7.5 app) I encountered the same issue.

I then edited mysql-client to default-mysql-client on line 36 in the .dockerdev/Dockerfile and ran the build command again. This time it was successful.

So not sure where you'd like to go from here. Maybe you want to close this since it appears to be an isolated issue that might only affect those on M1 Macs? It can then be re-opened another time if the issue appears more frequently.

Thoughts?

@johnpitchko
Copy link
Contributor Author

Also, when I boot the app container, I receive the following error:

Bundler can't satisfy your Gemfile's dependencies.

Install missing gems with `bundle install`.

Could not load OpenSSL.

You must recompile Ruby with OpenSSL support or change the sources in your

Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using

RVM are available at rvm.io/packages/openssl.

@waiting-for-dev
Copy link
Contributor

I think that having another person able to reproduce it is enough to merge it. I don't understand how the machine in use could have any effect (that's the whole point of Docker! 😅), but I tried switching mysql-client with default-mysql-client and it keeps working for me.

@johnpitchko, I was going to approve your PR, but I see you just closed it. Would you like to reopen it?

@RyanofWoods
Copy link
Contributor

RyanofWoods commented Aug 12, 2022

I am thinking that rebuilding the image with mysql-client still works for you both @waiting-for-dev and @gsmendoza, because the apt-get packages are cached 🤔

But I think because we don't specify a platform to use, it uses the system's architecture for the base platform. And for example, there are different package requirements needed for Nokogiri depending on the platform:
https://nokogiri.org/tutorials/installing_nokogiri.html#supported-platforms

(This is what's causing my Docker to still fail when trying to run the sandbox app - aarch64-linux is used and requires glibc >= 2.29, but the image has glibc at 2.28 )

I needed to add unbundled bundle config set force_ruby_platform true to bin/sandbox in order to get it to work 👀 I need to investigate this a lot more though.

@RyanofWoods
Copy link
Contributor

RyanofWoods commented Aug 12, 2022

Also, when I boot the app container, I receive the following error:

Bundler can't satisfy your Gemfile's dependencies.

Install missing gems with `bundle install`.

Could not load OpenSSL.

You must recompile Ruby with OpenSSL support or change the sources in your

Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using

RVM are available at rvm.io/packages/openssl.

I am getting this problem with images where I have specified the Ruby version to be 2.7.5, (but for some reason 2.7.1 is used). But when I don't specify a version and it's defaulting to the latest version: ruby 3.1.2p20, this problem doesn't occur. @johnpitchko 👀
rvm/rvm#4781

@johnpitchko
Copy link
Contributor Author

@johnpitchko, I was going to approve your PR, but I see you just closed it. Would you like to reopen it?

@waiting-for-dev Oops not sure what happened there. Anyways, I reopened as #4503.

@waiting-for-dev
Copy link
Contributor

I am thinking that rebuilding the image with mysql-client still works for you both @waiting-for-dev and @gsmendoza, because the apt-get packages are cached thinking

IIRC, I removed the Docker volumes, so no cache should have been used 🤷

But I think because we don't specify a platform to use, it uses the system's architecture for the base platform. And for example, there are different package requirements needed for Nokogiri depending on the platform:
https://nokogiri.org/tutorials/installing_nokogiri.html#supported-platforms

I'm not an expert in use, but I think the host platform shouldn't matter. But, please, keep us posted on any updates you find out about it!

@waiting-for-dev Oops not sure what happened there. Anyways, I reopened as #4503.

@johnpitchko, I approved your PR. We need another approval from a core team member.

@kennyadsl
Copy link
Member

Closing this, after #4503 merge. Thanks again @johnpitchko

@elmergustavo
Copy link

tanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants