Packer로 Bahmni Vagrant Box 빌드
이 문서는 Packer를 사용해 Bahmni Vagrant Box를 빌드하는 방법을 설명합니다. Packer는 이미지 빌드 시 컴퓨터에 필요한 모든 소프트웨어를 설치·설정하고 빌드 결과를 Vagrant Box로 변환할 수 있습니다. 자세한 내용: https://www.packer.io/intro/index.html
Bahmni Vagrant Box 빌드 단계
- 1. Packer를 설치합니다: https://www.packer.io/intro/getting-started/setup.html
- 2. GitHub에서 bahmni-vagrant 저장소를 복제합니다.
git clone https://github.com/Bahmni/bahmni-vagrant.git - 3. bahmni-vagrant 디렉터리에서 예를 들어 python render_template.py 0.88 2.2.0.0을 실행합니다. packer 디렉터리에 template.json이 생성되며 이미 있으면 template_rendered.json이 생성됩니다.
cd bahmni-vagrant python render_template.py <bahmni_version> <ansible_version> e.g: python render_template.py 0.88 2.2.0.0 - 4. packer 디렉터리에서 빌드 명령을 실행하기 전에 template_rendered.json에서 Atlas로 Box를 전송하는 자격 증명 관련 줄을 삭제합니다. 직접 삭제하는 대신 jq로 동적으로 제거할 수도 있습니다.
jq '.["post-processors"][0] |= map(select(.type != "atlas"))' template_rendered.json | packer build -cd packer packer build template_rendered.json - 5. Atlas 자격 증명을 제거한 뒤 Packer 빌드를 실행합니다. Packer가 원격 저장소에서 CentOS 이미지를 내려받아 Bahmni Vagrant Box를 빌드하며 전체 과정은 최소 한 시간이 걸립니다.
원문 정보
원문 보기 ↗Bahmni Wiki · CC BY-SA 4.0