update ruby version

This commit is contained in:
Dylan Knutson
2025-07-21 22:26:54 +00:00
parent fd61616c03
commit b1de28d80f
9 changed files with 95 additions and 57 deletions

View File

@@ -1,18 +1,22 @@
# Primary image # Primary image
FROM mcr.microsoft.com/devcontainers/ruby:1-3.2-bookworm FROM mcr.microsoft.com/devcontainers/base:debian-12
# apt caching & install packages # apt caching & install packages
RUN rm -f /etc/apt/apt.conf.d/docker-clean; \ RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \ apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \ apt-get install --no-install-recommends --no-install-suggests -qqy \
libicu-dev \
abiword \
autoconf \ autoconf \
build-essential \ build-essential \
ca-certificates \ ca-certificates \
curl \ curl \
ffmpeg \
ffmpegthumbnailer \
gnupg \ gnupg \
iputils-ping \ iputils-ping \
libblas-dev \ libblas-dev \
@@ -25,18 +29,18 @@ RUN \
libncurses5-dev \ libncurses5-dev \
libpq-dev \ libpq-dev \
libreadline6-dev \ libreadline6-dev \
libreoffice \
libsqlite3-dev \
libssl-dev \ libssl-dev \
libvips42 \ libvips42 \
libyaml-dev \ libyaml-dev \
patch \ patch \
uuid-dev \
zlib1g-dev \
watchman \
ffmpeg \
ffmpegthumbnailer \
abiword \
pdftohtml \ pdftohtml \
libreoffice pkg-config \
rustc \
uuid-dev \
watchman \
zlib1g-dev
# Install postgres 15 client # Install postgres 15 client
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -44,8 +48,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
sudo install -d /usr/share/postgresql-common/pgdg && \ sudo install -d /usr/share/postgresql-common/pgdg && \
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt update && \ sudo apt update && \
apt-get install --no-install-recommends --no-install-suggests -y \ sudo apt-get install --no-install-recommends --no-install-suggests -qqy \
postgresql-client-15 postgresql-client-15
# Install & configure delta diff tool # Install & configure delta diff tool
@@ -63,22 +67,36 @@ RUN git config --system core.pager "delta" && \
git config --system diff.algorithm "histogram" && \ git config --system diff.algorithm "histogram" && \
git config --system diff.colorMoved "default" git config --system diff.colorMoved "default"
# Install ruby
USER vscode
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv
ENV PATH="/home/vscode/.rbenv/bin:/home/vscode/.rbenv/shims:$PATH"
RUN echo 'eval "$(rbenv init - --no-rehash bash)"' >> ~/.bashrc
RUN git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
RUN rbenv install 3.4.4 && \
rbenv global 3.4.4
ENV RAILS_ENV development ENV RAILS_ENV development
# [Optional] Uncomment this line to install additional gems. # Pre install gems to speed up container startup
RUN su vscode -c "gem install bundler -v '2.5.6'" && \ USER root
su vscode -c "gem install rake -v '13.0.6'" && \ RUN mkdir -p /tmp/bundle-install-cache && \
su vscode -c "gem install ruby-lsp -v '0.22.1'" chown -R vscode:vscode /tmp/bundle-install-cache
WORKDIR /tmp/bundle-install-cache
USER vscode
COPY Gemfile.lock Gemfile ./
COPY gems/has_aux_table ./gems/has_aux_table
RUN BUNDLE_FROZEN=true MAKE="make -j$(nproc)" bundle install --jobs $(nproc)
# install exo # install exo
RUN su vscode -c "curl -sL https://exo.deref.io/install | bash" RUN curl -sL https://exo.deref.io/install | bash
ENV PATH "/home/vscode/.exo/bin:$PATH" ENV PATH "/home/vscode/.exo/bin:$PATH"
# install just (command runner) # install just (command runner)
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install 18 && nvm use 18 && npm install -g yarn" 2>&1 # RUN source /usr/local/share/nvm/nvm.sh && nvm install 18 && nvm use 18 && npm install -g yarn 2>&1
ENV PATH /usr/local/share/nvm/current/bin:$PATH # ENV PATH /usr/local/share/nvm/current/bin:$PATH
# install `backlog` tool # # install `backlog` tool
RUN su vscode -c "npm i -g backlog.md" # RUN npm i -g backlog.md

View File

@@ -7,7 +7,26 @@
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": { "features": {
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {}, "ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {},
"ghcr.io/nikobockerman/devcontainer-features/fish-persistent-data:2": {} "ghcr.io/nikobockerman/devcontainer-features/fish-persistent-data:2": {},
"ghcr.io/devcontainers-extra/features/npm-package:1": {
"package": "backlog.md"
}
},
"customizations": {
"vscode": {
"extensions": [
"Shopify.ruby-extensions-pack",
"dbaeumer.vscode-eslint",
"aliariff.vscode-erb-beautify",
"bradlc.vscode-tailwindcss",
"KoichiSasada.vscode-rdbg",
"qwtel.sqlite-viewer",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker",
"1YiB.rust-bundle",
"rust-lang.rust-analyzer"
]
}
}, },
// Use 'forwardPorts' to make a list of ports inside the container available locally. // Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or the host. // This can be used to network with other containers or the host.

View File

@@ -0,0 +1 @@
status --is-interactive; and rbenv init - --no-rehash fish | source

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "gems/has_aux_table"]
path = gems/has_aux_table
url = ssh://git@git.dy.mk:2221/dymk/has_aux_table.git

View File

@@ -1 +1 @@
system 3.4.4

View File

@@ -1,5 +1,5 @@
# Primary image # Primary image
FROM ruby:3.2.6 FROM ruby:3.4.4
USER root USER root
# apt caching & install packages # apt caching & install packages
@@ -14,10 +14,10 @@ RUN \
libblas-dev liblapack-dev libblas-dev liblapack-dev
# preinstall gems that take a long time to install # preinstall gems that take a long time to install
RUN MAKE="make -j12" gem install bundler -v '2.5.6' --verbose RUN MAKE="make -j12" gem install bundler -v '2.6.7'
RUN MAKE="make -j12" gem install rice -v '4.3.3' --verbose RUN MAKE="make -j12" gem install rice -v '4.3.3'
RUN MAKE="make -j12" gem install faiss -v '0.3.2' --verbose RUN MAKE="make -j12" gem install faiss -v '0.3.2'
RUN MAKE="make -j12" gem install rails_live_reload -v '0.3.6' --verbose RUN MAKE="make -j12" gem install rails_live_reload -v '0.3.6'
RUN bundle config --global frozen 1 RUN bundle config --global frozen 1
# set up nodejs 18.x deb repo # set up nodejs 18.x deb repo
@@ -46,9 +46,8 @@ RUN \
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./ COPY Gemfile Gemfile.lock ./
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config COPY gems/has_aux_table ./gems/has_aux_table
RUN bundle config --local frozen 1 RUN ls -lah gems && BUNDLE_FROZEN=true MAKE="make -j$(nproc)" bundle install --jobs $(nproc)
RUN --mount=type=ssh bundle install
# install js dependencies # install js dependencies
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./

11
Gemfile
View File

@@ -1,20 +1,17 @@
source "https://rubygems.org" source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" } git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "~> 3.2" ruby "~> 3"
gem "bundler", "~> 2.6.7"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.2" gem "rails", "~> 7.2"
gem "has_aux_table", gem "has_aux_table", path: "gems/has_aux_table"
git: "ssh://git@git.dy.mk:2221/dymk/has_aux_table.git",
branch: "main"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails" gem "sprockets-rails"
# Use sqlite3 as the database for Active Record
gem "pg" gem "pg"
gem "sqlite3", "~> 1.4"
gem "pry" gem "pry"
gem "pry-stack_explorer" gem "pry-stack_explorer"
@@ -58,7 +55,7 @@ gem "bootsnap", require: false
group :development, :test, :staging do group :development, :test, :staging do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", "~> 1.10", platforms: %i[mri mingw x64_mingw] gem "debug", "~> 1.11", platforms: %i[mri mingw x64_mingw]
end end
group :development, :staging do group :development, :staging do

View File

@@ -24,10 +24,8 @@ GIT
railties railties
websocket-driver websocket-driver
GIT PATH
remote: ssh://git@git.dy.mk:2221/dymk/has_aux_table.git remote: gems/has_aux_table
revision: fb7912e3536c339cba55af54c3e647f69f5997f3
branch: main
specs: specs:
has_aux_table (0.1.0) has_aux_table (0.1.0)
activerecord (>= 7.0) activerecord (>= 7.0)
@@ -155,7 +153,7 @@ GEM
db-query-matchers (0.14.0) db-query-matchers (0.14.0)
activesupport (>= 4.0, < 8.1) activesupport (>= 4.0, < 8.1)
rspec (>= 3.0) rspec (>= 3.0)
debug (1.10.0) debug (1.11.0)
irb (~> 1.10) irb (~> 1.10)
reline (>= 0.3.8) reline (>= 0.3.8)
debug_inspector (1.2.0) debug_inspector (1.2.0)
@@ -212,16 +210,22 @@ GEM
fugit (>= 1.11.0) fugit (>= 1.11.0)
railties (>= 6.1.0) railties (>= 6.1.0)
thor (>= 1.0.0) thor (>= 1.0.0)
google-protobuf (4.29.2-aarch64-linux) google-protobuf (4.31.1-aarch64-linux-gnu)
bigdecimal bigdecimal
rake (>= 13) rake (>= 13)
google-protobuf (4.29.2-arm64-darwin) google-protobuf (4.31.1-aarch64-linux-musl)
bigdecimal bigdecimal
rake (>= 13) rake (>= 13)
google-protobuf (4.29.2-x86_64-darwin) google-protobuf (4.31.1-arm64-darwin)
bigdecimal bigdecimal
rake (>= 13) rake (>= 13)
google-protobuf (4.29.2-x86_64-linux) google-protobuf (4.31.1-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.31.1-x86_64-linux-gnu)
bigdecimal
rake (>= 13)
google-protobuf (4.31.1-x86_64-linux-musl)
bigdecimal bigdecimal
rake (>= 13) rake (>= 13)
htmlbeautifier (1.4.3) htmlbeautifier (1.4.3)
@@ -589,10 +593,6 @@ GEM
actionpack (>= 6.1) actionpack (>= 6.1)
activesupport (>= 6.1) activesupport (>= 6.1)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.7.3-aarch64-linux)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
stackprof (0.2.26) stackprof (0.2.26)
stimulus-rails (1.3.4) stimulus-rails (1.3.4)
railties (>= 6.0.0) railties (>= 6.0.0)
@@ -669,6 +669,7 @@ DEPENDENCIES
addressable addressable
attr_json attr_json
bootsnap bootsnap
bundler (~> 2.6.7)
capybara capybara
charlock_holmes charlock_holmes
cloudflare-rails cloudflare-rails
@@ -679,7 +680,7 @@ DEPENDENCIES
curb curb
daemons daemons
db-query-matchers (~> 0.14) db-query-matchers (~> 0.14)
debug (~> 1.10) debug (~> 1.11)
devise (~> 4.9) devise (~> 4.9)
dhash-vips dhash-vips
discard discard
@@ -742,7 +743,6 @@ DEPENDENCIES
spring-commands-parallel-tests spring-commands-parallel-tests
spring-commands-rspec spring-commands-rspec
sprockets-rails sprockets-rails
sqlite3 (~> 1.4)
stackprof stackprof
stimulus-rails stimulus-rails
syntax_tree (~> 6.2) syntax_tree (~> 6.2)
@@ -762,4 +762,4 @@ RUBY VERSION
ruby 3.2.6p234 ruby 3.2.6p234
BUNDLED WITH BUNDLED WITH
2.6.2 2.6.7

1
gems/has_aux_table Submodule

Submodule gems/has_aux_table added at fb7912e353