I am new to dockerization and I am trying to make a docker image out of git repository. The Dockerfile looks like this,
FROM continuumio/miniconda3:latestENV PYTHONDONTWRITEBYTECODE=1ENV PYTHONUNBUFFERED=1WORKDIR /fire_danger_toolCOPY . /fire_danger_tool/.SHELL ["/bin/bash", "--login", "-c"]RUN apt updateRUN apt install -y build-essential gfortranRUN conda initRUN conda create -p /fire_danger_tool/env/fireml python=3.10RUN echo "conda activate /fire_danger_tool/env/fireml" > ~/.bashrcRUN conda install -c conda-forge mambaRUN mamba initRUN mamba install -c conda-forge gdal cython cf-units=3.2.0 esmpy WORKDIR /fire_danger_tool/frameworks/geokube/RUN python setup.py installWORKDIR /fire_danger_toolRUN --mount=type=cache,target=/root/.cache/pip \ --mount=type=bind,source=requirements.txt,target=requirements.txt \ python -m pip install -r requirements.txtRUN cp -f /fire_danger_tool/env/fireml/lib/libstdc++.so.6 /usr/lib/aarch64-linux-gnu/libstdc++.so.6RUN python -c "from geokube.core.datacube import DataCube"WORKDIR /fire_danger_tool/frameworks/kit4dl/RUN pip install -e .WORKDIR /fire_danger_toolARG UID=10001RUN adduser \ --disabled-password \ --gecos "" \ --home "/nonexistent" \ --shell "/sbin/nologin" \ --no-create-home \ --uid "${UID}" \ appuserUSER appuserEXPOSE 8000CMD python src/inference.py --date=2018-08-20 --conf=src/config/inference_config.toml --collect_data --prepare_static ARG UID=10001 RUN adduser \ --disabled-password \ --gecos "" \ --home "/nonexistent" \ --shell "/sbin/nologin" \ --no-create-home \ --uid "${UID}" \ appuser USER appuser EXPOSE 8000 CMD python src/inference.py --date=2018-08-20 --conf=src/config/inference_config.toml --collect_data --prepare_static
The docker image is created without error. But when I run the docker image, it seems that the conda environment is not already activated in the image. Moreover, conda has not been initiated. I need the conda environment because one of the libraries I need is only available in conda or to be installed from the source. Installing the said library from the source had its own problems.
Is there a way to create a docker image with the conda environment already activated?