Error: Building Image Using buildah Instead of Docker Commands

I am trying to build an image and push to a private registry using “buildah”.

Image build fails at the first layer with the Error - “creating build container: short-name resolution enforced but cannot prompt without a TTY”.
I am able to run the job with the same Dockerfile and push the image to docker registry.

Details :
GitLab version - 16.5

Error pic Below:

Base image in docker file - FROM maven:3.8.6-jdk-11-slim

.yml file for the build job below: Have kept it same as in GitLab Documentation

image_build:
image: Quay
variables:
STORAGE_DRIVER: vfs
BUILDAH_FORMAT: docker
FQ_IMAGE_NAME: “$CI_REGISTRY_IMAGE/test”

before_script:
    
    - echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY

script:
- buildah images
- buildah build -t $FQ_IMAGE_NAME
- buildah images
- buildah push $FQ_IMAGE_NAME

I would really appreciate if someone helps me with this issue.

I was able to build the image. For buildah we need to give from where we are using the base image in the docker file.
In Dockerfile
Earlier - FROM maven:3.8.6-jdk-11-slim (I t was throwing error)
Updated - FROM docker.io/maven:3.8.6-jdk-11-slim (It was successful)

1 Like