Dockerfile를 수정하는 방법?

다른 Docker 컨테이너 몇 개를 가지고 있으며, 다음과 같은 단계를 실행합니다:

# 현재 디렉터리 내용을 컨테이너의 /app 경로에 복사
COPY html /usr/share/nginx/html/
COPY dim.local.crt /etc/nginx/ssl/
COPY dim.local.key /etc/nginx/ssl/
COPY nginx.conf /etc/nginx/
COPY default.conf /etc/nginx/sites-enabled/

# requirements.txt에 지정된 필요한 패키지를 설치
#RUN pip install -r requirements.txt

# COPY 명령어 실행 후 nginx를 재시작해야 하는가?
RUN 

RUN apt-get update && \
    apt-get install -y nano && \
    rm -fr /var/lib/apt/lists/*

Discourse 컨테이너에도 비슷한 단계를 수행해야 하는데, Dockerfile은 어디에 있나요? containers/app.yml 파일의 끝에 이 내용을 추가할 수 있다는 글을 읽었지만, 확신이 서지 않습니다.

누군가 설명해 주실 수 있을까요?

정확히 어떤 도움이 필요하신지 설명해 주시겠어요?

커스텀 인증서를 추가하기 위해 Dockerfile을 수정할 필요는 없습니다. 해당 작업에 대한 가이드가 Allow SSL / HTTPS for your Discourse Docker setup 에 있습니다.

완전히 똑같은 걸 하려는 건 아닙니다. 그냥 셸 스크립트와 crontab를 컨테이너에 복사해서 몇 가지 작업을 자동화하고 싶을 뿐이에요.

app.yml 파일의 마지막 5줄에는 커스텀 명령 실행 예시가 포함되어 있습니다. 예를 들어 다음을 추가할 수 있습니다.

- exec: curl example.com/script.sh | bash

이렇게 하면 해당 스크립트를 다운로드하여 실행합니다.

네, 그 부분은 확인됩니다. 하지만 재빌드할 때마다 복사 오류가 발생합니다:

## 빌드 후 실행할 사용자 지정 명령
run:
  - exec: echo "Beginning of custom commands"
  ## 첫 번째 가입 시 'From' 이메일 주소를 설정하려면 아래 주석을 해제하고 수정하세요:
  ## 첫 가입 이메일을 받은 후에는 해당 줄을 다시 주석 처리하세요. 한 번만 실행하면 됩니다.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  
  - exec: cp /shared/rr/run_badges.sh /etc/cron.d/.
  - exec: cp /shared/rr/badges /etc/cron.d/.
  - exec: echo "End of custom commands"

오류 로그도 함께 공유해 주세요.

URL에서 가져오는 것도 가능할 것 같네요. 그런 방법도 있겠군요.

해당 파일은 호스트에 실제로 존재합니다:

# ls -al shared/rr/
badges         run_badges.sh
#

에러 메시지는 다음과 같습니다:

FAILED
--------------------
Pups::ExecError: cp /shared/rr/run_badges.sh /etc/cron.d/. failed with return #<Process::Status: pid 1457 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "cp /shared/rr/run_badges.sh /etc/cron.d/."
e23ff12630c8058c4b36ee8673404dafbe6791ec61aa630f1224400eba4e75e0
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

컨테이너 내부의 /shared 디렉터리는 기본적으로 /var/discourse/shared/standalone에 매핑되므로, 해당 경로에 디렉터리가 하나 누락되어 있습니다.

@Falco에게 질문합니다.

어떤 실수를 하고 있는 건가요?

명령어:

- exec: cp /shared/standalone/sql/run_badges.sh /root
Pups::ExecError: cp /shared/standalone/sql/run_badges.sh /root 실패, 반환값 #<Process::Status: pid 1728 exit 1>

사실 이 솔루션이 꽤 잘 작동합니다. 알려주셔서 감사합니다.