Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6501

(GCP-Cloud build)Docker: COPY failed: file not found in build context (Dockerfile)

$
0
0

I am currently struggling with COPY instruction in Dockerfile.

Step #0: Installing collected packages: tbb, python-decouple, intel-openmp, urllib3, tzdata, typing_extensions, tqdm, threadpoolctl, sqlparse, six, safetensors, regex, PyYAML, PyJWT, psycopg2-binary, pillow, packaging, networkx, MarkupSafe, joblib, idna, fsspec, filelock, django-widget-tweaks, colorama, charset-normalizer, certifi, requests, python-dateutil, Jinja2, gunicorn, asgiref, huggingface-hub, Django, tokenizers, djangorestframework, djangorestframework-simplejwtStep #0: Successfully installed Django-5.0.6 Jinja2-3.1.4 MarkupSafe-2.1.5 PyJWT-2.8.0 PyYAML-6.0.1 asgiref-3.8.1 certifi-2024.7.4 charset-normalizer-3.3.2 colorama-0.4.6 django-widget-tweaks-1.5.0 djangorestframework-3.15.2 djangorestframework-simplejwt-5.3.1 filelock-3.15.4 fsspec-2024.6.1 gunicorn-22.0.0 huggingface-hub-0.24.3 idna-3.7 intel-openmp-2021.4.0 joblib-1.4.2 networkx-3.3 packaging-24.1 pillow-10.4.0 psycopg2-binary-2.9.9 python-dateutil-2.9.0.post0 python-decouple-3.8 regex-2024.5.15 requests-2.32.3 safetensors-0.4.3 six-1.16.0 sqlparse-0.5.0 tbb-2021.13.0 threadpoolctl-3.5.0 tokenizers-0.19.1 tqdm-4.66.4 typing_extensions-4.12.2 tzdata-2024.1 urllib3-2.2.2Step #0: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venvStep #0: Step #0: [notice] A new release of pip is available: 23.0.1 -> 24.2Step #0: [notice] To update, run: pip install --upgrade pipStep #0: Removing intermediate container 3fe3c845384eStep #0:  ---> e229e4e549e4Step #0: Step 5/8 : COPY . /app/Step #0:  ---> bbd7f8e842baStep #0: Step 6/8 : COPY .env .envStep #0: COPY failed: file not found in build context or excluded by .dockerignore: stat .env: file does not existFinished Step #0ERRORERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1

I have not excluded in .dockerignore

How can I do it?File .env is stored in the same dir as Dockerfile.

i dont no

Dockerfile

# 베이스이미지설정FROM python:3.10-slim# 작업디렉토리설정WORKDIR /app# 필요한파일들을작업디렉토리로복사COPY requirements.txt /app/RUN pip install -r requirements.txtCOPY . /app/COPY .env .env# 장고의 static 파일을모음RUN python manage.py collectstatic --noinput# 장고애플리케이션을시작CMD ["gunicorn", "--bind", "0.0.0.0:8000", "config.wsgi:application"]

Viewing all articles
Browse latest Browse all 6501


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>