I am trying to create a docker container for miniconda3 using "docker-compose build", however below error code shows.
UNANSWERED NEW QUESTION
Or is there any better way to work with continuumio/miniconda3 docker image to make sure it is pre-installed with some desired list of python packages (for example, through pip install --r requirements.txt or conda create --name myenv --file environment.yml or any other efficient ways)? (or any ways to could continue installing python packages and save those packages after miniconda3 image had been created?)
=> ERROR [4/4] RUN conda env create --name data_science --file environment.yml 160.6s
------
> [4/4] RUN conda env create --name data_science --file environment.yml:
#8 8.635 Collecting package metadata (repodata.json): ...working... done
#8 148.5 Solving environment: ...working... failed
#8 148.5
#8 148.5 ResolvePackageNotFound:
#8 148.5 - vs2015_runtime==14.29.30037=h902a5da_5
#8 148.5 - python==3.9.7=h7840368_2_cpython
#8 148.5 - setuptools==58.0.4=py39hcbf5309_2
#8 148.5 - sqlite==3.36.0=h8ffe710_2
#8 148.5 - vc==14.2=hb210afc_5
#8 148.5 - openssl==1.1.1l=h8ffe710_0
#8 148.5 - ca-certificates==2021.5.30=h5b45459_0
#8 148.5 - ucrt==10.0.20348.0=h57928b3_0
#8 148.5
------
executor failed running [/bin/sh -c conda env create --name data_science --file environment.yml]: exit code: 1
ERROR: Service 'node' failed to build : Build failed
Below are the details for my Dockerfile, docker-compose.yml, environment.yml.
Dockerfile
FROM continuumio/miniconda3
WORKDIR /data
COPY environment.yml environment.yml
RUN conda env create --name data_science --file environment.yml
docker-compose.yml
version: "3.8"
services:
node:
build: .
volumes:
- .:/data
ports:
- 8888:8888
image: node:data
container_name: miniconda3
command:
- jupyter notebook --port=8888 --ip=0.0.0.0 --allow-root
environment.yml
name: python_data_science
channels:
- conda-forge
- default
dependencies:
- ca-certificates=2021.5.30=h5b45459_0
- openssl=1.1.1l=h8ffe710_0
- pip=21.2.4=pyhd8ed1ab_0
- python=3.9.7=h7840368_2_cpython
- python_abi=3.9=2_cp39
- setuptools=58.0.4=py39hcbf5309_2
- sqlite=3.36.0=h8ffe710_2
- tzdata=2021a=he74cb21_1
- ucrt=10.0.20348.0=h57928b3_0
- vc=14.2=hb210afc_5
- vs2015_runtime=14.29.30037=h902a5da_5
- wheel=0.37.0=pyhd8ed1ab_1
prefix: C:\Users\tys\.conda\envs\python_data_science
Hope for help. Thanks in advance.
UPDATED
Possible reason of failing:
I think it is because when i run "conda export env > environment.yml" on windows 10, conda will export my environment with builds, but builds can be platform-specific which is not suitable to be installed in miniconda3 linux in the docker container. For more info, refer to this stackoverflow forum, conda environment from windows to linux
Possible solution
(i) (Not sure how to solve yet, but may be could refer to this blog post for more information. Credit to @merv)
(ii) repo2docker