Reputation: 13
I just upgraded my docker desktop to a new version, and it broke my docker, other images work but the only one i need simply does not build and i got this error:
[internal] load metadata for docker.io/library/ruby:3.1.0-preview1-buster:
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
Docker file below and my machine is a Mac m1 running the latest version of docker-desktop.
# Good References
# https://github.com/dirkdk/docker-rails-demo
# https://www.digitalocean.com/community/tutorials/containerizing-a-ruby-on-rails-application-for-development-with-docker-compose
FROM ruby:3.1.0-preview1-buster
RUN apt-get update && apt-get -y install curl gnupg
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get -y update
RUN apt-get install --fix-missing --no-install-recommends -qq -y \
build-essential \
vim \
wget gnupg \
git-all \
curl \
ssh \
wkhtmltopdf \
postgresql-client-11 libpq5 libpq-dev -y
RUN wget -qO- https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
RUN apt-get update
RUN apt-get install yarn
RUN apt-get install less
RUN apt-get install nano
RUN apt-get install libmagickwand-dev
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG INSTALL_PATH=/firebolt
ENV INSTALL_PATH $INSTALL_PATH
WORKDIR $INSTALL_PATH
# Copy gemfile & package.json, do NOT install unless this is a production build
# For local development these are maintained in cached volumes
COPY Gemfile Gemfile.lock /firebolt/
COPY package.json yarn.lock ./
# Only need to pass in the rails master key if this is a production build
ARG production
COPY scripts/ /firebolt/scripts
RUN scripts/potential_package_install.sh $production
# Copy the entire directory
COPY . /firebolt
# For convenience, lets copy over a .bashrc file
COPY .bashrc /root/.bashrc
# Precompile assets if this is a production build and not in render (otherwise we use webpacker in development)
# Render (our cloud service provider) was having problems with precompiling assets because we would require more than
# 4GB of RAM and that's all they offered. There were a few options
# 1) They could increase their RAM limit (no plans to do so)
# 2) They could offer deployment straight from a private docker image (on the roadmap but currently requires build)
# 3) [Selected] We could commit the assets to our repo then skip the asset compilation step on render. We only do it in
# the github action which then submits another commit
ARG precompile_assets
RUN echo "Production Build: $precompile_assets"
RUN scripts/potential_asset_precompile.sh $precompile_assets
# Designate the entrypoint which will run migrations and start a rails server (this should only run for production)
# Overridden in docker-compose for development
# TODO: We shouldn't need to override this everywhere, we should just not be executing if it isn't production
RUN chmod +x scripts/migrate_and_start.sh
# Change ImageMagick PDF policy.xml
# RUN sed -i_bak 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
# Install jpg/pdf extensions
RUN apt-get -y update
RUN apt-get -y install poppler-utils
RUN apt-get -y install img2pdf
ENTRYPOINT [ "scripts/migrate_and_start.sh" ]
I've cleared the cache, cleared the images, reinstalled the docker, changed docker version and the image version.
Upvotes: 1
Views: 1042
Reputation: 94
You can test whether you can pull the docker image separately:
$ docker pull ruby:3.1.0-preview1-buster
If it is downloaded successfully then you should be able to build your Dockerfile.
If it doesn't work the image tag might not be compatible with the M1 machine. Then try another tag from Docker Hub.
Upvotes: 0