I am trying to copy a file from my host (Ubuntu 18.04) to a python container but I am having trouble copying it over. The purpose is to take my specific configuration for my default sound device and transfer it over so I don't have to do it manually later.
I've tried several variations and I am wondering if I am misunderstanding how to copy files over. I've checked the documentation and other various questions people on stackoverflow have asked regarding this like this one:
How to copy file from host to container using Dockerfile
But I get an error when I try the traditional command:
docker-compose build
...
Step 7/7 : COPY /config/.asoundrc ~/.asoundrc
COPY failed: file not found in build context or excluded by .dockerignore: stat config/.asoundrc: file does not exist
I don't have a docker ignore file in my root directory. My directory looks like this:
dejavu (root name)
-config
--.asoundrc
-docker-compose.yaml
...
To be clear, I want to copy the file config/.asoundrc
from my host to the container image, specifically the directory destination as ~/.asoundrc
Here is my dockerfile:
FROM python:3.7
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install \
gcc nano \
gdebi alsa-utils usbutils ffmpeg libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 \
postgresql postgresql-contrib pulseaudio -y
RUN pip install numpy scipy matplotlib pydub pyaudio psycopg2 sounddevice
WORKDIR /code
COPY /config/.asoundrc ~/.asoundrc
Here is the original repo, it's currently being modified from an open source project: https://github.com/datafaust/dejavu