Facing issues with building a Docker image for Conda-based software —need help resolving this

I am attempting to build a Docker image for a software package installed using Conda. The image needs to be built using the linux/amd64 architecture.

The build process takes excessively long (over 19 hours) and does not complete. How can I optimize the build process and ensure it successfully creates the Docker image?

Here is my Dockerfile and the build command I am using:

FROM continuumio/miniconda

WORKDIR /app

RUN git clone https://github.com/zstephens/telogator2.git

SHELL ["/bin/bash", "-c"]

# Create the conda environment
RUN conda env create -f telogator2/conda_env_telogator2.yaml

# Install additional tools via conda in one RUN layer for efficiency
RUN source activate telogator2 && \
conda install -y -c bioconda winnowmap muscle && \
conda clean -afy

# Ensure the conda environment is activated in future commands
ENV PATH="/opt/conda/envs/telogator2/bin:$PATH"

# Set entry point
ENTRYPOINT ["python", "telogator2/telogator2.py"]

docker buildx build --platform linux/amd64 -t telogator2:amd64 .

Since it is emulated, it is possible that you can’t make it faster. On macOS, you can try to change the virtualization method in the General settings. When it is available, you can enable “Use Rosetta for x86_64/amd64 emulation on Apple Silicon”.

If nothing helps, you will need to find a server that has amd64 architecture and use that for building.
You can also use a more recent image. Your base image is 5 years old and based on Python 2 which you should really replace with Python 3. Try searching for another miniconda Docker image.

It looks like the same maintainer has miniconda3 which is 4 hours old only

https://hub.docker.com/r/continuumio/miniconda3