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

Install pure Ruby sqlite3 gem #11

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Install pure Ruby sqlite3 gem #11

merged 2 commits into from
Dec 8, 2023

Conversation

jgarber623
Copy link
Contributor

The Docker images pushed to Docker Hub for tagged versions latest, 0, 0.9, and 0.9.0 (link), published on 22 August 2023, include several notable changes (compare):

  • Alpine Linux update from 3.15.4 to 3.16.7 (release history)
  • Mailcatcher 0.8.2 to 0.9.0

The former is significant as it includes a Ruby update from 3.0.4 to 3.1.4, though I don't believe that is introducing the issues detailed in #9.

The latter is significant as the build updates this gem's sqlite3 dependency from 1.4.4 (pure Ruby gem) to 1.6.3 (platform-native gem). The sqlite3 gem introduced platform-native builds from 1.5.0 (RubyGems version history), first published in July/September 2022.

As noted in the aforementioned issue, the published Docker images for ARM platforms are failing to launch.

#10 proposes adding the gcompat package to install glibc-compatible libraries into Alpine. I've used that on other projects running Alpine Linux to install Nokogiri, etc. Unfortunately, as I note in my comment on that PR, the resulting image crashes on a different error.

The proposed change here (reintroducing the pure Ruby sqlite3 gem) works around what might be a rabbit hole of issues I'm not equipped to solve.

This does result in longer Docker image build times, but I don't think that will negatively impact downstream consumers of the published images.

Addresses #9.

The Docker images pushed to Docker Hub for tagged versions `latest`,
`0`, `0.9`, and `0.9.0` [1], published on 22 August 2023, include
several notable changes [2]:

- Alpine Linux update from 3.15.4 to 3.16.7
- Mailcatcher 0.8.2 to 0.9.0

The former is significant as it includes a Ruby update from 3.0.4 to
3.1.4, though I don't believe that is introducing the issues detailed in
#9.

The latter is significant as the build updates this gem's sqlite3
dependency from 1.4.4 (pure Ruby gem) to 1.6.3 (platform-native gem).
The sqlite3 gem introduced platform-native builds from 1.5.0 [3], first
published in July/September 2022.

As noted in the aforementioned issue, the published Docker images for
ARM platforms are failing to launch.

#10 proposes adding the `gcompat` package to install
glibc-compatible libraries into Alpine. I've used that on other projects
running Alpine Linux to install Nokogiri, etc. Unfortunately, as I note
in my comment on that PR, the resulting image crashes on a _different_
error [4].

The proposed change here (reintroducing the pure Ruby sqlite3 gem) works
around what might be a rabbit hole of issues I'm not equipped to solve.

This _does_ result in longer Docker image build times, but I don't think
that will negatively impact downstream consumers of the published
images.

Addresses #9.

[1] https://hub.docker.com/r/dockage/mailcatcher/tags
[2] v0.8.2...v0.9.0
[3] https://rubygems.org/gems/sqlite3/versions
[4] #10 (comment)
@jgarber623
Copy link
Contributor Author

Alternatively, Mailcatcher's author publishes Docker images at: https://hub.docker.com/r/sj26/mailcatcher

Their Dockerfile implements a different version of my proposed change:

( [ "$(uname -m)" != "aarch64" ] || gem install sqlite3 --version="~> 1.3" --platform=ruby )

@winnieoursbrun
Copy link

Found the same solution from the same author. Work for me.

@winnieoursbrun
Copy link

Just missing this PR to be merged, and publish the image to be good to go.

@atkrad atkrad merged commit f1ef69f into dockage:main Dec 8, 2023
1 check passed
@jgarber623 jgarber623 deleted the use-sqlite3-ruby-platform-gem branch December 9, 2023 03:25
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

Successfully merging this pull request may close these issues.

3 participants