250x250
반응형
Notice
Recent Posts
Recent Comments
전산쟁이의 기억노트
buildah 기반의 컨테이너 생성 본문
728x90
반응형
SMALL
Buildah 명령어를 이용한 컨테이너 생성 절차.
Docker기반에서도 동일하게 컨테이너 생성 가능.
- buildah 패키지 설치
$> yum install buildah -y
- 컨테이너 생성을 위한 Dockerfile 생성
$> cat Dockerfile FROM docker.io/library/rockylinux RUN yum install tree httpd -y RUN mkdir -p /svc/http/ COPY ./httpd.conf /svc/http/
- buildah로 컨테이너 생성
$> buildah bud -t tree:1.0 STEP 1/4: FROM docker.io/library/rockylinux STEP 2/4: RUN yum install tree -y ... STEP 3/4: RUN mkdir -p /svc/http/ STEP 4/4: COPY ./httpd.conf /svc/http/ COMMIT tree:1.0 Getting image source signatures Copying blob b9674b668e06 skipped: already exists Copying blob 16ea5ea65710 done Copying config 9bee15c469 done Writing manifest to image destination Storing signatures --> 9bee15c4692 Successfully tagged localhost/tree:1.0 9bee15c469245cb180c1e3a21eb220241e1940fefd4b8d9d28ec34ea6c8df3bb
- 컨테이너 생성 여부 확인
$> podman image ls REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/rockylinux latest c830f8e8f82b 2 weeks ago 211 MB localhost/tree 1.0 a77e50505d7a 32 seconds ago 257 MB
- 생성된 이미지 띄워서 dockerfile에 정의된 절차대로 작업 되었는지 확인
$> podman run -dt localhost/tree:1.0 c0b576f3bc807c98d1eb48c6f943c48cc43acae2c20b33d7851878ae6224c9cf $> podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c0b576f3bc80 localhost/tree:1.0 /bin/bash 4 seconds ago Up 4 seconds ago dreamy_lamarr $> podman exec -it dreamy_lamarr tree /svc/ /svc/ `-- http `-- httpd.conf 1 directory, 1 file
출처
http://igoni.kr/books/linux/page/buildah
728x90
반응형
LIST
'컨테이너&가상화' 카테고리의 다른 글
xenserver localdisk 리포지터리 구성 (0) | 2022.10.24 |
---|---|
xenserver gpt disallow (0) | 2022.10.24 |
Harbor 설치가이드 (0) | 2022.08.12 |
docker기반의 nexus설치 (0) | 2022.08.07 |
pip로 docker-compose 설치 오류 (0) | 2022.08.07 |
Comments