Skip to content

Commit

Permalink
Dockerfile non x86 architectures (#46976)
Browse files Browse the repository at this point in the history
* Adjust whitespace and comments on Dockerfile stages

This commit is entirely cosmetic, though the first comment has a function:

https://docs.docker.com/build/buildkit/dockerfile-frontend/

* address DHH review comments

* handle non x86_64 targets

Fixes issue found by Bruno Prieto:
  https://discuss.rubyonrails.org/t/rails-dockerfile-futures/82091/4

Co-authored-by: David Heinemeier Hansson <david@hey.com>
  • Loading branch information
rubys and dhh committed Jan 12, 2023
1 parent 5625bbb commit 2641e06
Showing 1 changed file with 4 additions and 1 deletion.
@@ -1,3 +1,5 @@
# syntax = docker/dockerfile:1

# Make sure it matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=<%= Gem.ruby_version %>
FROM ruby:$RUBY_VERSION-slim as base
Expand Down Expand Up @@ -53,7 +55,8 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
FROM base

# Copy built artifacts: libraries, gems, application
COPY --from=build /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
RUN --mount=type=bind,from=build,source=/usr/lib,target=/build \
cp -rp /build/*-linux-gnu/* /usr/lib/*-linux-gnu
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build /rails /rails

Expand Down

0 comments on commit 2641e06

Please sign in to comment.