solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Docker image build fails

Open johnpitchko opened this issue 2 years ago • 8 comments

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

johnpitchko avatar Jul 31 '22 04:07 johnpitchko

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 ?

gsmendoza avatar Aug 01 '22 07:08 gsmendoza

@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 :thinking:

waiting-for-dev avatar Aug 01 '22 11:08 waiting-for-dev

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 👀

RyanofWoods avatar Aug 11 '22 15:08 RyanofWoods

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 avatar Aug 12 '22 03:08 johnpitchko

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.

johnpitchko avatar Aug 12 '22 03:08 johnpitchko

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! :sweat_smile:), 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?

waiting-for-dev avatar Aug 12 '22 04:08 waiting-for-dev

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 avatar Aug 12 '22 12:08 RyanofWoods

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 👀 https://github.com/rvm/rvm/issues/4781

RyanofWoods avatar Aug 12 '22 13:08 RyanofWoods

@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 https://github.com/solidusio/solidus/pull/4503.

johnpitchko avatar Aug 15 '22 01:08 johnpitchko

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 :shrug:

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 https://github.com/solidusio/solidus/pull/4503.

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

waiting-for-dev avatar Aug 15 '22 04:08 waiting-for-dev

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

kennyadsl avatar Aug 25 '22 12:08 kennyadsl

tanks

elmergustavo avatar Mar 17 '23 04:03 elmergustavo