Skip to content
New issue

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

Docker alpine hangs while apk add #549

Open
medicharlachiranjeevi opened this issue Aug 10, 2020 · 1 comment
Open

Docker alpine hangs while apk add #549

medicharlachiranjeevi opened this issue Aug 10, 2020 · 1 comment

Comments

@medicharlachiranjeevi
Copy link

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"]

@masterkain
Copy link

masterkain commented Oct 12, 2020

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

Screenshot 2020-10-12 at 17 35 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants