3.14. 이미지를 빌드하는 YAML 파일의 예
'ansible-builder' 빌드 명령은 실행 환경 정의를 입력으로 사용합니다. 실행 환경 이미지를 빌드하는 데 필요한 빌드 컨텍스트를 출력한 다음 해당 이미지를 빌드합니다. 이미지는 빌드 컨텍스트를 사용하여 다른 위치에 다시 빌드하고 동일한 결과를 생성할 수 있습니다. 기본적으로 빌더는 현재 디렉터리에서 execution-environment.yml
이라는 파일을 검색합니다.
다음 예제 execution-environment.yml
파일을 시작점으로 사용할 수 있습니다.
version: 3 dependencies: galaxy: requirements.yml The content of requirements.yml: --- collections: - name: awx.awx To build an execution environment using the preceding files and run the following command: ansible-builder build ... STEP 7: COMMIT my-awx-ee --> 09c930f5f6a 09c930f5f6ac329b7ddb321b144a029dbbfcc83bdfc77103968b7f6cdfc7bea2 Complete! The build context can be found at: context
version: 3
dependencies:
galaxy: requirements.yml
The content of requirements.yml:
---
collections:
- name: awx.awx
To build an execution environment using the preceding files and run the following command:
ansible-builder build
...
STEP 7: COMMIT my-awx-ee
--> 09c930f5f6a
09c930f5f6ac329b7ddb321b144a029dbbfcc83bdfc77103968b7f6cdfc7bea2
Complete! The build context can be found at: context
즉시 사용할 수 있는 컨테이너 이미지를 생성하는 것 외에도 빌드 컨텍스트가 유지됩니다. docker build 또는 podman build와 같은 툴을 사용하여 다른 시간이나 위치에 다시 빌드할 수 있습니다.