Docker build 시 에러 발생

엔케이·2025년 1월 7일

Rasa로 챗봇 만들기

목록 보기
1/1

에러 내용

docker build 실행시 문제 발생

=> ERROR [5/5] RUN python -m pip install --no-cache-dir -r requirements-actions.txt                                           2.5s
------                                                                                                                              
 > [5/5] RUN python -m pip install --no-cache-dir -r requirements-actions.txt:                                                      
1.299 Collecting requests==2.32.3                                                                                                   
1.470   Downloading requests-2.32.3-py3-none-any.whl (64 kB)                                                                        
1.498      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 2.7 MB/s eta 0:00:00                                               
1.507 Requirement already satisfied: charset-normalizer<4,>=2 in /opt/venv/lib/python3.10/site-packages (from requests==2.32.3->-r requirements-actions.txt (line 1)) (3.1.0)
1.508 Requirement already satisfied: idna<4,>=2.5 in /opt/venv/lib/python3.10/site-packages (from requests==2.32.3->-r requirements-actions.txt (line 1)) (3.4)
1.509 Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/venv/lib/python3.10/site-packages (from requests==2.32.3->-r requirements-actions.txt (line 1)) (1.26.16)
1.510 Requirement already satisfied: certifi>=2017.4.17 in /opt/venv/lib/python3.10/site-packages (from requests==2.32.3->-r requirements-actions.txt (line 1)) (2023.5.7)
2.080 Installing collected packages: requests
2.080   Attempting uninstall: requests
2.081     Found existing installation: requests 2.31.0
2.085     Uninstalling requests-2.31.0:
2.088 ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'INSTALLER'
2.088 Check the permissions.
2.088 
2.402 
2.402 [notice] A new release of pip available: 22.3.1 -> 24.3.1
2.402 [notice] To update, run: pip install --upgrade pip
------

 1 warning found (use docker --debug to expand):
 - FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" (line 2)
Dockerfile:12
--------------------
  10 |     # 추가 패키지 설치
  11 |     COPY requirements-actions.txt ./
  12 | >>> RUN python -m pip install --no-cache-dir -r requirements-actions.txt
  13 |     
  14 |     # 포트 노출
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c python -m pip install --no-cache-dir -r requirements-actions.txt" did not complete successfully: exit code: 1

사용한 Dockerfile

# Rasa 기본 이미지
FROM rasa/rasa:3.6.2

# 프로젝트 복사
COPY ./ /app

# 작업 디렉토리 설정
WORKDIR /app

# 추가 패키지 설치
COPY requirements-actions.txt ./
RUN python -m pip install --no-cache-dir -r requirements-actions.txt

# 포트 노출
EXPOSE 5005 5055

# Rasa 서버 및 Actions 서버 실행
CMD ["run", "-m", "models", "--enable-api", "--cors", "*", "--debug", "&", "rasa", "run", "actions"]

수정한 Dockerfile

# Rasa 기본 이미지
FROM rasa/rasa:3.6.2

# 프로젝트 복사
COPY ./ /app

# 작업 디렉토리 설정
WORKDIR /app

# 추가 패키지 설치
COPY requirements-actions.txt ./
RUN python -m pip install --no-cache-dir -r requirements-actions.txt

# 포트 노출
EXPOSE 5005 5055

# Rasa 서버 및 Actions 서버 실행
CMD ["run", "-m", "models", "--enable-api", "--cors", "*", "--debug", "&", "rasa", "run", "actions"]

에러원인(추정)

requirements-actions.txt에 패지키와 기본 이미지에 패키지가 충돌되면서 발생하는 문제로 판단됩니다.
requirements-actions.txt에 내용을 삭제하니 문제없이 빌드 완료된다.

profile
FE 개발자

0개의 댓글