diff --git a/Dockerfile b/Dockerfile index ab83343..fe34b6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,6 @@ ENV RAILS_ENV="production" \ APP_VERSION=${MANYFOLD_VERSION} \ HOME=/config -COPY --from=ruby:3.4.12-alpine3.24 /usr/local /usr/local/ - RUN \ apk add --no-cache \ alembic-libs \ @@ -45,6 +43,7 @@ RUN \ yaml && \ apk add --no-cache --virtual=build-dependencies \ build-base \ + crane \ git \ grep \ libffi-dev \ @@ -71,6 +70,9 @@ RUN \ /tmp/manyfold.tar.gz -C \ /app/www/ --strip-components=1 && \ cd /app/www && \ + RUBY_VERSION=$(cat .ruby-version) && \ + ALPINE_VERSION=$(cat /etc/os-release | grep "PRETTY_NAME" | sed -E 's|.* v([0-9\.]*).*|\1|') && \ + crane export --platform linux/amd64 library/ruby:${RUBY_VERSION}-alpine${ALPINE_VERSION} - | tar -xv -C / usr/local/ && \ npm install -g corepack && \ corepack enable yarn && \ yarn install && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index a7d6edc..0b2b730 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -18,8 +18,6 @@ ENV RAILS_ENV="production" \ APP_VERSION=${MANYFOLD_VERSION} \ HOME=/config -COPY --from=ruby:3.4.12-alpine3.24 /usr/local /usr/local/ - RUN \ apk add --no-cache \ alembic-libs \ @@ -45,6 +43,7 @@ RUN \ yaml && \ apk add --no-cache --virtual=build-dependencies \ build-base \ + crane \ git \ grep \ libffi-dev \ @@ -71,6 +70,9 @@ RUN \ /tmp/manyfold.tar.gz -C \ /app/www/ --strip-components=1 && \ cd /app/www && \ + RUBY_VERSION=$(cat .ruby-version) && \ + ALPINE_VERSION=$(cat /etc/os-release | grep "PRETTY_NAME" | sed -E 's|.* v([0-9\.]*).*|\1|') && \ + crane export --platform linux/arm64 library/ruby:${RUBY_VERSION}-alpine${ALPINE_VERSION} - | tar -xv -C / usr/local/ && \ npm install -g corepack && \ corepack enable yarn && \ yarn install && \