We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FROM ruby:2.7.1-alpine AS build-env ARG RAILS_ROOT=/app ARG BUILD_PACKAGES="build-base curl-dev git" ARG DEV_PACKAGES="postgresql-dev yaml-dev zlib-dev nodejs yarn imagemagick" ARG RUBY_PACKAGES="tzdata" ENV RAILS_ENV=staging ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle" WORKDIR $RAILS_ROOT RUN apk update \ && apk upgrade \ && apk add --update --no-cache $BUILD_PACKAGES $DEV_PACKAGES $RUBY_PACKAGES COPY Gemfile* package.json yarn.lock ./ COPY Gemfile Gemfile.lock $RAILS_ROOT/ RUN bundle config --global frozen 1 \ && bundle install --without development:test:assets -j4 --retry 3 --path=vendor/bundle \ && rm -rf vendor/bundle/ruby/2.5.0/cache/*.gem \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.c" -delete \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.o" -delete RUN yarn install COPY . .
FROM ruby:2.7.1-alpine AS build-env
ARG RAILS_ROOT=/app
ARG BUILD_PACKAGES="build-base curl-dev git"
ARG DEV_PACKAGES="postgresql-dev yaml-dev zlib-dev nodejs yarn imagemagick"
ARG RUBY_PACKAGES="tzdata"
ENV RAILS_ENV=staging
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
WORKDIR $RAILS_ROOT
RUN apk update \ && apk upgrade \ && apk add --update --no-cache $BUILD_PACKAGES $DEV_PACKAGES $RUBY_PACKAGES
COPY Gemfile* package.json yarn.lock ./
COPY Gemfile Gemfile.lock $RAILS_ROOT/
RUN bundle config --global frozen 1 \ && bundle install --without development:test:assets -j4 --retry 3 --path=vendor/bundle \ && rm -rf vendor/bundle/ruby/2.5.0/cache/*.gem \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.c" -delete \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.o" -delete
RUN yarn install
COPY . .
RUN bundle exec rake DATABASE_URL=postgresql:does_not_exist assets:precompile RUN rm -rf node_modules tmp/cache app/assets vendor/assets spec ############### Build step done ############### FROM ruby:2.7.1-alpine ARG RAILS_ROOT=/app ARG PACKAGES="tzdata postgresql-client imagemagick" ENV RAILS_ENV=staging ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle" WORKDIR $RAILS_ROOT RUN apk update \ && apk upgrade \ && apk add --update --no-cache $PACKAGES COPY --from=build-env $RAILS_ROOT $RAILS_ROOT EXPOSE 3000 CMD ["rails", "server", "-b", "0.0.0.0"]
RUN bundle exec rake DATABASE_URL=postgresql:does_not_exist assets:precompile
RUN rm -rf node_modules tmp/cache app/assets vendor/assets spec
############### Build step done ###############
FROM ruby:2.7.1-alpine
ARG PACKAGES="tzdata postgresql-client imagemagick"
RUN apk update \ && apk upgrade \ && apk add --update --no-cache $PACKAGES
COPY --from=build-env $RAILS_ROOT $RAILS_ROOT
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
The text was updated successfully, but these errors were encountered:
I have the same issue, same image (ruby 2.7 alpine), hangs while doing /bin/sh var/cache/misc/shared-mime-info-1.15-r0.trigger /usr/share/mime
/bin/sh var/cache/misc/shared-mime-info-1.15-r0.trigger /usr/share/mime
Sorry, something went wrong.
No branches or pull requests
My docker version is : 19.03.12
os: ubuntu : 20.04
every time i run docker build it hangs at apk add some package any help
My Dockerfile is
FROM ruby:2.7.1-alpine AS build-env
ARG RAILS_ROOT=/app
ARG BUILD_PACKAGES="build-base curl-dev git"
ARG DEV_PACKAGES="postgresql-dev yaml-dev zlib-dev nodejs yarn imagemagick"
ARG RUBY_PACKAGES="tzdata"
ENV RAILS_ENV=staging
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
WORKDIR $RAILS_ROOT
RUN apk update \ && apk upgrade \ && apk add --update --no-cache $BUILD_PACKAGES $DEV_PACKAGES $RUBY_PACKAGES
COPY Gemfile* package.json yarn.lock ./
COPY Gemfile Gemfile.lock $RAILS_ROOT/
RUN bundle config --global frozen 1 \ && bundle install --without development:test:assets -j4 --retry 3 --path=vendor/bundle \ && rm -rf vendor/bundle/ruby/2.5.0/cache/*.gem \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.c" -delete \ && find vendor/bundle/ruby/2.5.0/gems/ -name "*.o" -delete
RUN yarn install
COPY . .
RUN bundle exec rake DATABASE_URL=postgresql:does_not_exist assets:precompile
RUN rm -rf node_modules tmp/cache app/assets vendor/assets spec
############### Build step done ###############
FROM ruby:2.7.1-alpine
ARG RAILS_ROOT=/app
ARG PACKAGES="tzdata postgresql-client imagemagick"
ENV RAILS_ENV=staging
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
WORKDIR $RAILS_ROOT
RUN apk update \ && apk upgrade \ && apk add --update --no-cache $PACKAGES
COPY --from=build-env $RAILS_ROOT $RAILS_ROOT
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
The text was updated successfully, but these errors were encountered: