When building Dockerfile from an older version of ruby I’m getting a docker-cache error, see my Dockerfile to reproduce this error.

FROM ruby:1.9.3-p551

# Create app directory
RUN mkdir -p /app

WORKDIR /app

ENV RAILS_ENV=production
COPY . /app/
COPY Gemfile /app/
COPY Gemfile.lock /app/

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list

# Install dependencies
RUN apt-get update && apt-get install -qq -y build-essential nodejs npm && apt-get install -qq -y zip

RUN bundle install
RUN mkdir -p log
RUN touch $RAILS_ENV.log
RUN cp /usr/share/zoneinfo/America/Toronto /etc/localtime
#RUN bundle exec sidekiq -d -e $RAILS_ENV -C config/sidekiq.yml -L log/$RAILS_ENV.log

ENTRYPOINT ["bundle", "exec"]
EXPOSE 3000

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi there @manpreetnarang,

What is the exact docker build command that you are using? Also can you share the exact error that you are getting?

One thing that I could suggest is making sure that you have the base image in place with the docker images command.

As far as I can see it is still present on Dockerhub:

https://hub.docker.com/_/ruby?tab=tags&page=1&ordering=last_updated&name=1.9.3-p551

Regards,
Bobby

Hi @manpreetnarang, if you are seeing this error in your App Platform builds, it is because the ruby:1.9.3-p551 image uses a deprecated v1 Docker image manifest, which is not supported by App Platform.

As a workaround you can pull the image locally and push it to your own account, which will upgrade the manifest to v2, and then update the Dockerfile FROM to use your own version of the image:

docker pull ruby:1.9.3-p551
docker tag ruby:1.9.3-p551 your-dockerhub-username/ruby:1.9.3-p551
docker push your-dockerhub-username/ruby:1.9.3-p551

Let me know if that works!

Reference: https://docs.docker.com/registry/spec/deprecated-schema-v1/