I am trying to run inference results from https://github.com/mlcommons/inference_results_v3.1/blob/main/closed/Intel/code/gptj-99/pytorch-cpu/docker/Dockerfile_int4 which uses docker however instead of docker I have `apptainer so I have used https://singularityhub.github.io/singularity-cli/ to convert the docker file to an apptainer defintion file and trying to build the image.
Now while building the image I am getting the below error.
INFO: Adding environment to container
FATAL: While performing build: conveyor failed to get: reading manifest latest in docker.io/library/dev-base: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
To resolve the error above I tried deleting apptainer entries such as
Bootstrap: docker
From: dev-base
Stage: conda
which is an corresponding entry in apptainer for docker entry FROM dev-base as conda. However deleting the entries throws another error.
Looking for correct way to parse docker entries which are defined in docker for stages and what would be the corresponding entry for singularity/apptainer.
When converting Dockerfiles to Apptainer (formerly, Singularity) definition files, it is important to understand that Docker's multi-stage build process does not have a direct equivalent in Apptainer.
However, you can still achieve a similar outcome by carefully managing the build steps within a single Apptainer definition file. The error you have could mean an issue with accessing the Docker Hub repository, which could be due to missing authentication or the repository not being public.
If
dev-baseis a public image, make sure it is correctly named and publicly accessible. If it is private, you will need to authenticate. Apptainer allows you to pull Docker images by authenticating with Docker Hub using theapptainer remote logincommand.Since direct stage references (
FROM AS ...) from Docker do not translate directly, you must manually manage the build stages. Typically, this involves consolidating the steps into a single build process within your Apptainer definition file, or building intermediate images separately and then copying necessary files from those images.I.e:
dev-base) separately if it involves complex setups.As a simplified example for your Apptainer definition file, based on a hypothetical Docker multi-stage build:
That would not directly translate Docker's multi-stage functionality but allows you to build a similar end-result by manually managing the steps.
If using custom base images not available on public registries, you may need to build and store them in a location accessible to Apptainer, such as a private registry with authentication or directly on the filesystem where Apptainer can access them.