Home > OS >  Docker build file image issue
Docker build file image issue

Time:11-12

I am trying to build a docker file using ubi8/s2i-base:rhel8.5

The start of my docker file looks like

FROM ubi8/s2i-base:rhel8.5 as Builder

RUN apk add --update --no-cache \
    build-base \
    postgresql-dev \
    git \
    imagemagick \
    nodejs-current \
    yarn \
    tzdata

I am getting an error failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied

I am trying to use this image https://catalog.redhat.com/software/containers/ubi8/s2i-base/5c83976a5a13464733ec6790?container-tabs=technical-information&gti-tabs=registry-tokens. to build my python image.

Can any one advice me how to use a redhat base image in your docker file.

CodePudding user response:

The error is right in the message - pull access denied. You also have a second issue in your FROM statement in that you aren't specifying the full path the image you linked.

So you have two things to resolve:

  1. When you pull from redhat's registry, you'll need to provide the full URL and not just the image name. For the image you linked, that means you need "FROM registry.redhat.io/ubi8/s2i-base:rhel18.5 as Builder`.
  2. When you use Redhat's registry, they want you to create a service account and login with it. They provide instructions on how to do this under the "Get This Image" tag, but in short you need to use docker login to login to registry.redhat.io before you run your docker build command.

After you've resolved those issues, you have a third issue in your Dockerfile that you'll need to resolve:

  1. You're using the apk package manager to attempt to install packages, which is the package manager for Alpine linux. The image you're attempting to extend uses the yum package manager instead (you can see this in the provided Dockerfile for it), and so will need to use that package manager instead to install your dependencies.

Between those things, your pull access should be authorized correctly, and your build issues resolved.

  • Related