Skip to content

Commit 7affec1

Browse files
committed
Use slim docker image to fix sqlite3 issue
sqlite3 gem version 2.x fixes this but 1.x is required by Rails. Reference: sparklemotion/sqlite3-ruby#434
1 parent de35603 commit 7affec1

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Dockerfile

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile produces a production ready image of talos-manager.
22

33
ARG RUBY_VERSION=3.2.0
4-
FROM ruby:${RUBY_VERSION}-alpine as base
4+
FROM ruby:${RUBY_VERSION}-slim as base
55

66
WORKDIR /app
77

@@ -11,16 +11,20 @@ ENV BUNDLE_CLEAN=true
1111

1212
FROM base as talosctl
1313

14+
RUN apt-get update -qq && apt-get install --no-install-recommends -y wget
15+
1416
ARG TALOS_VERSION=1.7.4
17+
# TODO: This should use TARGETPLATFORM to determine the correct binary to download
1518
RUN wget https://github.com/siderolabs/talos/releases/download/v${TALOS_VERSION}/talosctl-linux-amd64 -O /usr/local/bin/talosctl
1619
RUN chmod +x /usr/local/bin/talosctl
1720

1821
FROM base as gems
1922

2023
# git for git based Gemfile definitions
21-
# build-base for native extensions
22-
# postgresql-dev for pg gem
23-
RUN apk add git build-base postgresql-dev
24+
# build-essential + pkg-config for native extensions
25+
# libpq-dev for pg gem
26+
RUN apt-get update -qq && \
27+
apt-get install --no-install-recommends -y build-essential pkg-config git libpq-dev
2428

2529
COPY .ruby-version .
2630
COPY Gemfile* ./
@@ -31,14 +35,12 @@ RUN rm -rf vendor/bundle/ruby/*/cache
3135

3236
FROM base
3337

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

4345
COPY --from=gems /app /app
4446
COPY --from=talosctl /usr/local/bin/talosctl /usr/local/bin/talosctl

0 commit comments

Comments
 (0)