본문 바로가기

docker-compose3

mongod --keyFile 시 permissions on /etc/mongodb.key are too open 또는 /etc/mongodb.key: bad file mongod --keyFile 시 permissions on /etc/mongodb.key are too open 또는 /etc/mongodb.key: bad file key: bad file or key are too open 에러 내용 docker-compose를 활용해 mongodb replica set을 구축하는 도중 위와 같은 에러들을 만났습니다. key: bad file or key are too open 에러 원인 permissions on /etc/mongodb.key are too open : keyFile의 mode가 소유자 읽기 전용(400)이 아닌 다른 유저들이 읽을 수 있는 등 보안이 필요한 keyFile에 올바르지 않은 mode를 가지고 있기 때문입니다. /etc/mongodb... 2023. 5. 12.
docker-compose 시 exited with code 0 또는 무한 재시작 에러 내용 docker-compose up exited with code 0 docker-compose 시 exited with code 0 가 나옵니다. always: true로 설정했을 시 exited with code 0 가 무한히 나옵니다. 에러 원인 docker container는 하나의 명령어를 실행합니다. 명령어의 수행이 끝나면 종료합니다.(정상적인 종료 == exit code 0) 따라서, 명령어를 주지 않거나 단발적으로 실행되고 끝나는 명령어( ls 같은)를 주면 곧바로 컨테이너가 종료됩니다. 정상적인 종료임으로 code 0를 반환하며 종료됩니다. 해결 방법 끝나지 않는 명령을 시키거나 명령이 끝나도 종료되지 않도록 설정합니다. 1. "command: node index.js"등 종료되지.. 2022. 10. 22.
docker-compose up 명령 시 ~service 'app' must be a mapping not a string. 에러 내용 ERROR: In file './docker-compose.yml', service 'front' must be a mapping not a string. docker-compose up 명령 시 위와 같은 메시지가 나오고 더 이상 앱을 빌드하지 않습니다. 에러 원인 docker-copose.yml의 문법 오류(syntax error)가 원인입니다. 보통 들여쓰기를 하지 않아 발생합니다. 하지만 저의 경우는 띄어쓰기를 실수하여 발생하였습니다. 해결 방법 docker compose specification을 참고하여 문법 오류를 수정하면 해결됩니다. 자주 실수하는 문법 오류는 다음과 같습니다. 들여 쓰기(indentation) : 공백 두 개 띄어쓰기(spacing) : ":" 뒤에 공백 하나 .. 2022. 10. 22.