Skip to content

Commit

Permalink
Use slim docker image to fix sqlite3 issue
Browse files Browse the repository at this point in the history
sqlite3 gem version 2.x fixes this but 1.x is required by Rails.

Reference: sparklemotion/sqlite3-ruby#434
  • Loading branch information
dbackeus committed Jun 18, 2024
1 parent de35603 commit 5fc63d5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This Dockerfile produces a production ready image of talos-manager.

ARG RUBY_VERSION=3.2.0
FROM ruby:${RUBY_VERSION}-alpine as base
FROM ruby:${RUBY_VERSION}-slim as base

WORKDIR /app

Expand All @@ -18,9 +18,10 @@ RUN chmod +x /usr/local/bin/talosctl
FROM base as gems

# git for git based Gemfile definitions
# build-base for native extensions
# postgresql-dev for pg gem
RUN apk add git build-base postgresql-dev
# build-essential + pkg-config for native extensions
# libpq-dev for pg gem
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential pkg-config git libpq-dev

COPY .ruby-version .
COPY Gemfile* ./
Expand All @@ -31,14 +32,12 @@ RUN rm -rf vendor/bundle/ruby/*/cache

FROM base

# libc6-compat required by nokogiri aarch64-linux
# libpq required by pg
# tzdata required by tzinfo
# libcurl required by typhoeus
# wget for talosctl installation
# curl is required for the heroku release command output
# sqlite-libs required by sqlite3 (only used if DB_ADAPTER=sqlite)
RUN apk add wget libc6-compat tzdata libcurl libpq curl sqlite-libs
# curl is required for typhoeus and the heroku release command output
# libsqlite3-0 for sqlite3
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y wget curl libsqlite3-0 postgresql-client file && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

COPY --from=gems /app /app
COPY --from=talosctl /usr/local/bin/talosctl /usr/local/bin/talosctl
Expand Down

0 comments on commit 5fc63d5

Please sign in to comment.