Docker Community Forums

Share and learn in the Docker community.

Yaml file issue

I have a yaml file within python code, I use the following dockerfile for configuration

    FROM python:3
    COPY requirements.txt ./
    RUN pip install --no-cache-dir -r requirements.txt
    COPY . .
    CMD [ "python", "./" ]

The yaml file was not copied.
Any idea how to resolve this?

Best regards,

I was wondering if there is a strict policy checking on file types when adding configuration from a file.
Here’s MWE of what I encountered as errror:

import sacred
expr = sacred.Experiment(‘test-experiment’, interactive=True)

Traceback (most recent call last):
File “”, line 1, in
File “/home/user/miniconda3/envs/experiments/lib/python3.7/site-packages/sacred/”, line 195, in add_config
File “/home/user/miniconda3/envs/experiments/lib/python3.7/site-packages/sacred/”, line 218, in _create_config_dict
return ConfigDict(load_config_file(abspath))
File “/home/user/miniconda3/envs/experiments/lib/python3.7/site-packages/sacred/config/”, line 41, in load_config_file
handler = get_handler(filename)
File “/home/user/miniconda3/envs/experiments/lib/python3.7/site-packages/sacred/config/”, line 37, in get_handler
return HANDLER_BY_EXT[extension]
KeyError: ‘.yml’

I have a configuration for my project as a yaml. Shall I change the dockerfile in order to copy the yaml into the docker image?