So I am trying to dockerize a Discord bot I built. In the picture are my file structure and Dockerfile. The problem I have is that it doesn't copy requirements.txt
.
Actually, I was watching a video on how to do it, but I ran into this problem. This is the first Dockerfile I have made.
What I aim to do: copying the whole file structure as is and when the image starts, it runs bot.py
.
This is the Dockerfile written out.
FROM python:3
WORKDIR /Helix
COPY requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
EXPOSE 3306:3306
EXPOSE 443:443
EXPOSE 50:50
RUN apt-get update \
&& apt-get install libasound-dev libportaudio2 libportaudiocpp0 portaudio19-dev -y \
&& pip install pyaudio
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "bot.py"]
The error that I keep getting is:
I:\HELIX\Modules\Discord\Helix>docker build -t sinless777/helix_bot - < Dockerfile
failed to get console mode for stdin: The handle is invalid.
[+] Building 1.7s (7/11)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 468B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3 1.2s
=> [internal] load build context 0.1s
=> => transferring context: 2B 0.0s
=> CANCELED [1/7] FROM docker.io/library/python:3@sha256:437585501d11ef4b4b831cf8a6d6611eb526e327006d506bcedcfdea3fde442a 0.3s
=> => resolve docker.io/library/python:3@sha256:437585501d11ef4b4b831cf8a6d6611eb526e327006d506bcedcfdea3fde442a 0.0s
=> => sha256:437585501d11ef4b4b831cf8a6d6611eb526e327006d506bcedcfdea3fde442a 2.60kB / 2.60kB 0.0s
=> => sha256:3d11a72c123ffc9326b86ad432480cef0ab73f02b7ed684873c2f8c35ce9a79f 2.22kB / 2.22kB 0.0s
=> => sha256:4246fb19839fd033a0dd925c1f89cd1ad482c6b703d56f34bf0d2808b076e132 8.61kB / 8.61kB 0.0s
=> CACHED [2/7] WORKDIR /Helix 0.0s
=> ERROR [3/7] COPY requirements.txt ./ 0.0s
------
> [3/7] COPY requirements.txt ./:
------
failed to compute cache key: "/requirements.txt" not found: not found