15 Commits

Author SHA1 Message Date
2bef46ea1b use Docker cache mount for apk
All checks were successful
Gitea Actions Demo / lint (push) Successful in 25s
Gitea Actions Demo / test (push) Successful in 13s
Gitea Actions Demo / docker (push) Successful in 3m23s
2025-05-05 22:51:18 -05:00
19d1e60d2f use Docker cache mount for Ruby bundler 2025-05-05 22:47:24 -05:00
2da770623f use Docker cache mount for Ruby gems 2025-05-05 22:46:42 -05:00
e90966970a move main ENV section in Dockerfiles 2025-05-05 22:45:52 -05:00
a54a46b0a6 use Docker cache mount for apt 2025-05-05 22:18:04 -05:00
a719e5f820 add Docker DX 2025-05-05 22:06:27 -05:00
3c4f656ec8 add Docker ARG for DEBIAN_VERSION 2025-05-02 15:37:41 -05:00
e0e6bf2507 add Docker ARG for BASE_REGISTRY 2025-05-02 15:32:26 -05:00
84908c0a24 set Debian frontend to noninteractive 2025-05-02 15:28:56 -05:00
762169f563 enable Ruby's YJIT 2025-05-02 15:27:33 -05:00
066078f23c v0.2.1
All checks were successful
Gitea Actions Demo / lint (push) Successful in 17s
Gitea Actions Demo / test (push) Successful in 11s
Gitea Actions Demo / docker (push) Successful in 2m54s
2025-04-30 22:48:09 -05:00
f201287a9b remove rackup gem
Some checks failed
Gitea Actions Demo / lint (push) Successful in 21s
Gitea Actions Demo / test (push) Successful in 13s
Gitea Actions Demo / docker (push) Has been cancelled
2025-04-30 22:44:35 -05:00
4fd8dd78ef use jemalloc
Some checks failed
Gitea Actions Demo / lint (push) Successful in 24s
Gitea Actions Demo / test (push) Successful in 15s
Gitea Actions Demo / docker (push) Has been cancelled
2025-04-30 21:51:49 -05:00
16139755e5 remove old Dockerfile 2025-04-30 21:04:19 -05:00
8e960419b4 use docker/setup-qemu-action
All checks were successful
Gitea Actions Demo / lint (push) Successful in 22s
Gitea Actions Demo / test (push) Successful in 16s
Gitea Actions Demo / docker (push) Successful in 2m59s
2025-04-30 17:01:57 -05:00
11 changed files with 67 additions and 89 deletions

View File

@ -6,7 +6,7 @@
"vscode": {
"extensions": [
"Shopify.ruby-lsp",
"ms-azuretools.vscode-docker"
"docker.docker"
]
}
},

View File

@ -85,6 +85,9 @@ jobs:
printf "GITHUB_SHA=%s\n" "$GITHUB_SHA"
printf "VERSION=%s\n" "$VERSION" | tee -a "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

View File

@ -1,42 +0,0 @@
ARG RUBY_VERSION="3.4.3"
FROM ruby:${RUBY_VERSION} AS base
WORKDIR /app
RUN <<EOT
apt-get update
gem update --system --no-document
gem install -N bundler
EOT
FROM base AS build
RUN <<EOT
apt-get install --yes gcc make
EOT
COPY Gemfile* .
RUN <<EOT
bundle config set --local without development
bundle install
EOT
FROM base
ENV PORT=4567
# RUN useradd ruby --home /app --shell /bin/sh
RUN useradd --home /app --create-home app
USER app:app
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=app:app /app /app
COPY --chown=app:app . .
EXPOSE 4567
CMD [ "puma", "--bind", "0.0.0.0", "--port", "$PORT" ]

View File

@ -3,7 +3,6 @@ source "https://rubygems.org"
gem "sinatra"
gem "sinatra-contrib"
gem "puma"
gem "rackup"
gem "anyflake"
gem "ksuid"

View File

@ -45,8 +45,6 @@ GEM
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rainbow (3.1.1)
rake (13.2.1)
rbs (3.9.2)
@ -138,7 +136,6 @@ DEPENDENCIES
nanoid
puma
rack-test
rackup
rake
rspec
ruby-lsp

2
app.rb
View File

@ -21,7 +21,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + "/lib"
require "config"
VERSION = "0.2.0"
VERSION = "0.2.1"
CHUNK_SIZE = 1024**2
SESSION_SECRET_HEX_LENGTH = 64

View File

@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.0"
appVersion: "0.2.1"

View File

@ -1,34 +1,38 @@
ARG RUBY_VERSION="3.4.3"
FROM docker.io/library/ruby:${RUBY_VERSION}-alpine AS base
WORKDIR /kubernaut
RUN <<EOT
apk update -q
apk add bash
rm -rf /var/cache/apk
gem update --system --no-document
gem install -N bundler
EOT
ARG BASE_REGISTRY="docker.io"
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-alpine AS base
ENV RACK_ENV="production" \
BUNDLE_DEPLOYMENT=true \
BUNDLE_PATH="/usr/local/bundle" \
BUNDLE_WITHOUT="development test"
BUNDLE_WITHOUT="development test" \
RUBY_YJIT_ENABLE=true
WORKDIR /kubernaut
RUN \
--mount=type=cache,id=var-cache-apk,target=/var/cache/apk,sharing=locked \
apk update -q; \
apk add bash jemalloc
RUN \
--mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
gem update --system --no-document; \
gem install -N bundler
FROM base AS build
RUN <<EOT
apk add musl-dev gcc make
rm -rf /var/cache/apk
EOT
RUN \
--mount=type=cache,id=var-cache-apk,target=/var/cache/apk,sharing=locked \
apk update -q; \
apk add musl-dev gcc make; \
apk add bash jemalloc
COPY Gemfile Gemfile.lock ./
RUN <<EOT
RUN \
--mount=type=cache,id=usr-local-bundle-ruby-cache,target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
bundle install
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
EOT
COPY . .

View File

@ -1,34 +1,46 @@
ARG RUBY_VERSION="3.4.3"
FROM docker.io/library/ruby:${RUBY_VERSION}-slim-bookworm AS base
WORKDIR /kubernaut
RUN <<EOT
apt-get update -qq
rm -rf /var/lib/apt/lists /var/cache/apt/archives
gem update --system --no-document
gem install -N bundler
EOT
ARG BASE_REGISTRY="docker.io"
ARG DEBIAN_VERSION="bookworm"
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS base
ENV RACK_ENV="production" \
BUNDLE_DEPLOYMENT=true \
BUNDLE_PATH="/usr/local/bundle" \
BUNDLE_WITHOUT="development test"
BUNDLE_WITHOUT="development test" \
RUBY_YJIT_ENABLE=true
WORKDIR /kubernaut
RUN rm -f /etc/apt/apt.conf.d/docker-clean
RUN \
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
apt-get update -qq; \
apt-get install --yes --no-install-recommends \
libjemalloc2
RUN \
--mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
gem update --system --no-document; \
gem install -N bundler
ENV DEBIAN_FRONTEND="noninteractive"
FROM base AS build
RUN <<EOT
apt-get update -qq
apt-get install --yes --no-install-recommends gcc make libc-dev
rm -rf /var/lib/apt/lists /var/cache/apt/archives
EOT
RUN \
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
apt-get update -qq; \
apt-get install --yes --no-install-recommends \
build-essential
COPY Gemfile Gemfile.lock ./
RUN <<EOT
RUN \
--mount=type=cache,id=usr-local-bundle-ruby-cache,target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
bundle install
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
EOT
COPY . .

View File

@ -7,4 +7,9 @@ ruby --version
printf "rubygems %s\n" "$(gem --version)"
bundle version
if [ -z "${LD_PRELOAD+x}" ]; then
LD_PRELOAD="$(find /usr/lib -name libjemalloc.so.2 -print -quit)"
export LD_PRELOAD
fi
exec "${@}"

View File

@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: kubernaut
image: git.kill0.net/ryanc/kubernaut:0.2.0
image: git.kill0.net/ryanc/kubernaut:0.2.1
imagePullPolicy: Always
ports:
- name: sinatra-web