다음과 같이 진행했습니다:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
chmod 700 containers
그 후 기존 app.yml을 containers 디렉토리로 복사하고 앱을 다시 빌드하려 했습니다:
[root@two discourse]# ./launcher rebuild app
x86_64 아키텍처 감지됨.
launcher가 최신 상태인지 확인 중
launcher는 최신 상태입니다
기존 컨테이너 중지 중
+ /usr/bin/docker stop -t 600 app
app
2.0.20250722-0020: discourse/base에서 가져오는 중
Digest: sha256:3b975c30ef85e9742e2d7f6093450867e67dae204c93d22cc38d043dcbf530b3
Status: discourse/base:2.0.20250722-0020 이미지가 최신 상태입니다
docker.io/discourse/base:2.0.20250722-0020
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-09-12T19:05:09.283821 #1] INFO -- : stdin에서 읽는 중
I, [2025-09-12T19:05:09.296585 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2025-09-12T19:05:09.301579 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2025-09-12T19:05:09.307391 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2025-09-12T19:05:09.313597 #1] INFO -- : File > /root/install_postgres chmod: +x chown:
I, [2025-09-12T19:05:09.319914 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2025-09-12T19:05:09.320255 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 data_directory = '/var/lib/postgresql/15/main'을 data_directory = '/shared/postgres_data'로 대체
I, [2025-09-12T19:05:09.323526 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?listen_addresses *=.*)을 listen_addresses = '*'로 대체
I, [2025-09-12T19:05:09.324153 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?synchronous_commit *=.*)을 synchronous_commit = $db_synchronous_commit로 대체
I, [2025-09-12T19:05:09.324577 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?shared_buffers *=.*)을 shared_buffers = $db_shared_buffers로 대체
I, [2025-09-12T19:05:09.324945 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?work_mem *=.*)을 work_mem = $db_work_mem으로 대체
I, [2025-09-12T19:05:09.325369 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?default_text_search_config *=.*)을 default_text_search_config = '$db_default_text_search_config'로 대체
I, [2025-09-12T19:05:09.325759 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?checkpoint_segments *=.*)을 checkpoint_segments = $db_checkpoint_segments로 대체
I, [2025-09-12T19:05:09.329467 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?logging_collector *=.*)을 logging_collector = $db_logging_collector로 대체
I, [2025-09-12T19:05:09.330304 #1] INFO -- : /etc/postgresql/15/main/postgresql.conf에서 (?-mix:#?log_min_duration_statement *=.*)을 log_min_duration_statement = $db_log_min_duration_statement로 대체
I, [2025-09-12T19:05:09.330761 #1] INFO -- : /etc/postgresql/15/main/pg_hba.conf에서 (?-mix:^#local +replication +postgres +peer$)을 local replication postgres peer로 대체
I, [2025-09-12T19:05:09.331823 #1] INFO -- : /etc/postgresql/15/main/pg_hba.conf에서 (?-mix:^host.*all.*all.*127.*$)을 host all all 0.0.0.0/0 md5로 대체
I, [2025-09-12T19:05:09.332230 #1] INFO -- : /etc/postgresql/15/main/pg_hba.conf에서 (?-mix:^host.*all.*all.*::1\/128.*$)을 host all all ::/0 md5로 대체
I, [2025-09-12T19:05:09.332621 #1] INFO -- : > if [ -f /root/install_postgres ]; then
/root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi
mkdir: 디렉터리 ‘/shared/postgres_run’ 생성 불가: 권한 거부
chown: '/shared/postgres_run' 접근 불가: 그런 파일 또는 디렉터리가 없습니다
chmod: '/shared/postgres_run' 접근 불가: 그런 파일 또는 디렉터리가 없습니다
mkdir: 디렉터리 ‘/shared/postgres_run’ 생성 불가: 권한 거부
chown: '/shared/postgres_run/15-main.pg_stat_tmp' 접근 불가: 그런 파일 또는 디렉터리가 없습니다
install: ‘/shared/postgres_data’의 소유자와 권한 변경 불가: 그런 파일 또는 디렉터리가 없습니다
initdb: 오류: 디렉터리 "/shared/postgres_data" 생성 불가: 권한 거부
find: ‘/shared/postgres_data’: 그런 파일 또는 디렉터리가 없습니다
chown: '/var/run/postgresql' 참조 해제 불가: 그런 파일 또는 디렉터리가 없습니다
cat: /shared/postgres_data/PG_VERSION: 그런 파일 또는 디렉터리가 없습니다
du: '/shared/postgres_data' 접근 불가: 그런 파일 또는 디렉터리가 없습니다
/root/upgrade_postgres: 7번째 줄: * 2: 구문 오류: 피연산자 예상됨 (오류 토큰은 "* 2")
I, [2025-09-12T19:05:12.122891 #1] INFO -- : 로케일 생성 중 (시간이 좀 걸릴 수 있습니다)...
en_US.UTF-8... 완료
생성 완료.
이 데이터베이스 시스템에 속하는 파일들은 "postgres" 사용자가 소유합니다.
이 사용자는 서버 프로세스도 소유해야 합니다.
데이터베이스 클러스터는 로케일 "en_US.UTF-8"로 초기화됩니다.
기본 데이터베이스 인코딩은 이에 따라 "UTF8"으로 설정되었습니다.
기본 텍스트 검색 구성은 "english"로 설정됩니다.
데이터 페이지 체크섬은 비활성화됩니다.
디렉터리 /shared/postgres_data 생성 중 ... PostgreSQL을 버전에서 15로 업그레이드
실패(FAILED)
--------------------
Pups::ExecError: if [ -f /root/install_postgres ]; then
/root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi
실행 결과 #<Process::Status: pid 18 exit 1>로 실패
실패 위치: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec가 파라미터 {"tag"=>"db", "cmd"=>"if [ -f /root/install_postgres ]; then\n /root/install_postgres && rm -f /root/install_postgres\nelif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then\n socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1\nfi\n"}와 함께 실패
bootstrap이 종료 코드 1로 실패
** BOOTSTRAP 실패 ** 이전의 오류 메시지를 확인하려면 위로 스크롤하세요. 하나 이상일 수 있습니다.
./discourse-doctor가 문제를 진단하는 데 도움이 될 수 있습니다.
c9c7badf83b119a15b40255ae48a05182f72663cc870ca85e867c1f9a218bb83
컨테이너 내부에서 처음부터 권한 문제가 있는 것 같습니다:
mkdir: cannot create directory ‘/shared/postgres_run’: Permission denied
이것의 원인은 무엇일 수 있을까요?