LoginSignup
1
1

More than 3 years have passed since last update.

Podman 기본명령어 튜토리얼

Last updated at Posted at 2020-02-26

podman-logo.png

TL;DR

Podman(포드맨)은 Docker와 비교해서 1) 데몬이 필요 없다. 2) 일반 계정이 사용 가능하다 라는 특징이 있습니다.
Podman 설치와 기본명령어 사용을 기록하였습니다.

테스트 환경

  • Ubuntu 18.04
  • Podman 1.8.0

Podman 설치

Ubuntu 18.04 에서 설치한 방법을 기록했습니다.
https://podman.io/getting-started/installation.html 에 OS 별 설치 방법이 기술되어져 있습니다.

$ apt-get install kubeadm=1.13.4-00 kubelet=1.13.4-00 kubectl=1.13.4-00 kubernetes-cni=0.6.0-00
$ apt install containernetworking-plugins
$ ufw disable # 방화벽 해제
$ . /etc/os-release
$ sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
$ wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
$ sudo apt-get update -qq
$ apt-get -qq -y install podman
$ podman --version
podman version 1.8.0

1. Podman 이미지 실행

모든 명령어는 podman 사용자를 생성한 후, podman 계정으로 진행하였습니다.
또한 Docker Hubpodman은 잘 호환 된다고 해서 Docker Hub의 Jenkins 이미지를 실습에 사용하였습니다.

$ adduser podman
Adding user `podman' ...
Adding new group `podman' (1002) ...
Adding new user `podman' (1002) with group `podman' ...
Creating home directory `/home/podman' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for podman
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y
$ su - podman
$ whoami
podman

이미지 다운로드 (podman pull)

$ podman pull jenkins/jenkins:lts
podman pull jenkins/jenkins:lts
Trying to pull docker.io/jenkins/jenkins:lts...
Getting image source signatures
Copying blob 9935d0c62ace done
Copying blob 3d3bf7f7e874 done
Copying blob db0efb86e806 done
Copying blob e705a4c4fd31 done
Copying blob 49371c5b9ff6 done
Copying blob 146bd6a88618 done
Copying blob 3f7eaaf7ad75 done
Copying blob c174316783db done
Copying blob 024826a29afe done
Copying blob 51f2bbab8803 done
Copying blob a5270cffee3a done
Copying blob 083f0f43b51d done
Copying blob 6ce657881f7a done
Copying blob ffda073f8127 done
Copying blob 215073008675 done
Copying blob 3672d2dcba21 done
Copying blob 906db372d194 done
Copying blob 66fb46692c0e done
Copying blob 3a9a81b17595 done
Copying config d9abe6b78d done
Writing manifest to image destination
Storing signatures
d9abe6b78d139ce22debcfe6fdc05f6edc614735479134b60d0b162d78dbba0a

이미지 목록 출력 (podman images)

$ podman images
REPOSITORY                  TAG   IMAGE ID       CREATED       SIZE
docker.io/jenkins/jenkins   lts   d9abe6b78d13   3 weeks ago   581 MB

이미지 세부 정보 확인 (podman inspect)

$ podman inspect jenkins/jenkins:lts
[
    {
        "Id": "d9abe6b78d139ce22debcfe6fdc05f6edc614735479134b60d0b162d78dbba0a",
        "Digest": "sha256:54486ebab0d42582a84fc35b184c4f5cf9998d139bbec552bc6ec8c617c4a055",
        "RepoTags": [
            "docker.io/jenkins/jenkins:lts"
        ],
        "RepoDigests": [
            "docker.io/jenkins/jenkins@sha256:54486ebab0d42582a84fc35b184c4f5cf9998d139bbec552bc6ec8c617c4a055"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2020-01-29T14:31:00.000269545Z",
        "Config": {
            "User": "jenkins",
            "ExposedPorts": {
                "50000/tcp": {},
                "8080/tcp": {}
            },
            "Env": [
                "PATH=/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "JAVA_HOME=/usr/local/openjdk-8",
                "JAVA_VERSION=8u242",
                "JAVA_BASE_URL=https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_",
                "JAVA_URL_VERSION=8u242b08",
                "JENKINS_HOME=/var/jenkins_home",
                "JENKINS_SLAVE_AGENT_PORT=50000",
                "REF=/usr/share/jenkins/ref",
                "JENKINS_VERSION=2.204.2",
                "JENKINS_UC=https://updates.jenkins.io",
                "JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental",
                "JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals",
                "COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log"
            ],

중략 ...

 {
                "created": "2020-01-29T14:31:00.000269545Z",
                "created_by": "/bin/sh -c #(nop) COPY file:78c99e4fdfb9fc7b7295ceb786f9e2c3ae66e7f4a4e68a3e0c0548e6e804ffbf in /usr/local/bin/inst
all-plugins.sh "
            }
        ],
        "NamesHistory": []
    }
]

이미지 태그 설정 (podman tag)

$ podman tag jenkins/jenkins:lts leechungkyu/jenkins:2.204.2
$ podman images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
docker.io/jenkins/jenkins       lts       d9abe6b78d13   3 weeks ago   581 MB
localhost/leechungkyu/jenkins   2.204.2   d9abe6b78d13   3 weeks ago   581 MB
$ podman tag jenkins/jenkins:lts docker.io/leechungkyu/jenkins:2.204.2
$ podman images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
localhost/leechungkyu/jenkins   2.204.2   d9abe6b78d13   3 weeks ago   581 MB
docker.io/leechungkyu/jenkins   2.204.2   d9abe6b78d13   3 weeks ago   581 MB
docker.io/jenkins/jenkins       lts       d9abe6b78d13   3 weeks ago   581 MB

이미지 검색 (podman search)

$ podman search --tls-verify jenkins
INDEX        NAME                                                                   DESCRIPTION                                       STARS   OFFICIAL   AUTOMATED
docker.io    docker.io/library/jenkins                                              Official Jenkins Docker image                     4663    [OK]
docker.io    docker.io/jenkinsci/jenkins                                            Jenkins Continuous Integration and Delivery ...   378         
docker.io    docker.io/jenkinsci/jnlp-slave                                         A Jenkins slave using JNLP to establish conn...   120                [OK]
docker.io    docker.io/jenkins/jenkins                                              The leading open source automation server         1916        
docker.io    docker.io/jenkins/jnlp-slave                                           a Jenkins agent (FKA "slave") using JNLP to ...   114                [OK]
docker.io    docker.io/jenkinsci/blueocean                                          https://jenkins.io/projects/blueocean             494         
docker.io    docker.io/jameseckersall/jenkins                                       docker-jenkins (based on openshift jenkins 2...   0                  [OK]
docker.io    docker.io/ansibleplaybookbundle/jenkins-apb                            An APB which deploys Jenkins CI                   1                  [OK]
docker.io    docker.io/publicisworldwide/jenkins-slave                              Jenkins Slave based on Oracle Linux               5                  [OK]
docker.io    docker.io/openshift/jenkins-2-centos7                                  A Centos7 based Jenkins v2.x image for use w...   21          
docker.io    docker.io/openshift/jenkins-slave-base-centos7                         A Jenkins slave base image. DEPRECATED: see ...   7           
docker.io    docker.io/jenkinsci/slave                                              Base Jenkins slave docker image                   62                 [OK]
docker.io    docker.io/cloudbees/jenkins-enterprise                                 CloudBees Jenkins Enterprise (Rolling releas...   34                 [OK]
docker.io    docker.io/jenkins/slave                                                base image for a Jenkins Agent, which includ...   38                 [OK]
docker.io    docker.io/bitnami/jenkins                                              Bitnami Docker Image for Jenkins                  21                 [OK]
docker.io    docker.io/h1kkan/jenkins-docker                                        🤖 Extended Jenkins docker image, bundled ...      26         
docker.io    docker.io/amazeeio/jenkins-slave                                       A jenkins slave that connects to a master vi...   0                  [OK]
docker.io    docker.io/openshift/jenkins-1-centos7                                  DEPRECATED: A Centos7 based Jenkins v1.x ima...   4           
docker.io    docker.io/cloudbees/jenkins-operations-center                          CloudBees Jenkins Operation Center (Rolling ...   14                 [OK]
docker.io    docker.io/jenkinsci/ssh-slave                                          A Jenkins SSH Slave docker image                  41                 [OK]
docker.io    docker.io/trion/jenkins-docker-client                                  Jenkins CI server with docker client              4                  [OK]
docker.io    docker.io/vfarcic/jenkins-swarm-agent                                  Jenkins agent based on the Swarm plugin           8                  [OK]
docker.io    docker.io/mashape/jenkins                                              Just a jenkins image with the AWS cli added ...   0                  [OK]
docker.io    docker.io/xmartlabs/jenkins-android                                    Jenkins image for Android development.            26                 [OK]
docker.io    docker.io/killercentury/jenkins-dind                                   Generic Jenkins CI with Docker Engine and Do...   29                 [OK]
redhat.com   registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7        A jenkins maven slave image.                      0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-slave-base-rhel7         A base that other jenkins slave images can b...   0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-agent-nodejs-8-rhel7     The jenkins agent nodejs image has the nodej...   0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-slave-nodejs-rhel7       A Jenkins nodejs slave image.                     0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-20-jenkins-slave-rhel7        .NET Core 2.0 Jenkins Slave for RHEL              0           
redhat.com   registry.access.redhat.com/openshift4/ose-jenkins-agent-maven          'A jenkins maven agent image.'                    0           
redhat.com   registry.access.redhat.com/openshift4/ose-jenkins-agent-nodejs         'A Jenkins nodejs agent image.'                   0           
redhat.com   registry.access.redhat.com/dotnet-beta/dotnet-21-jenkins-slave-rhel7   .NET Core 2.1 Jenkins Slave for RHEL              0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-21-jenkins-slave-rhel7        .NET Core 2.1 Jenkins Slave for RHEL              0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-22-jenkins-slave-rhel7        .NET Core 2.2 Jenkins Slave for RHEL              0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-2-rhel7                  This image provides a Jenkins server, primar...   0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-1-rhel7                  Jenkins image which can be used to set up a ...   0           
redhat.com   registry.access.redhat.com/openshift4/ose-jenkins                      'Jenkins continuous integration server'           0           
redhat.com   registry.access.redhat.com/openshift4/ose-jenkins-agent-base           'Jenkins base agent image'                        0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-31-jenkins-agent-rhel7        Provides the latest release of Red Hat Enter...   0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-30-jenkins-slave-rhel7        Provides the latest release of Red Hat Enter...   0           
redhat.com   registry.access.redhat.com/dotnet/dotnet-31-jenkins-slave-rhel7        Provides the latest release of Red Hat Enter...   0           
redhat.com   registry.access.redhat.com/openshift3/jenkins-agent-maven-35-rhel7     This Maven agent image supports using a Mave...   0           

이미지 삭제 (podman rmi)

$ podman images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
docker.io/jenkins/jenkins       lts       d9abe6b78d13   3 weeks ago   581 MB
localhost/leechungkyu/jenkins   2.204.2   d9abe6b78d13   3 weeks ago   581 MB
docker.io/leechungkyu/jenkins   2.204.2   d9abe6b78d13   3 weeks ago   581 MB

$ podman rmi localhost/leechungkyu/jenkins:2.204.2
Untagged: localhost/leechungkyu/jenkins:2.204.2

$ podman rmi docker.io/leechungkyu/jenkins:2.204.2
Untagged: docker.io/leechungkyu/jenkins:2.204.2

$ podman images
REPOSITORY                  TAG   IMAGE ID       CREATED       SIZE
docker.io/jenkins/jenkins   lts   d9abe6b78d13   3 weeks ago   581 MB

2. Podman 컨테이너 생성/구동/중지

컨테이너 생성 및 백그라운드 실행 (podman run)

$ podman run --name jenkins -d -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
cc1faf8b449995fd5ac4f9d925eabd3f85842965e362e1746f4dc01f6a954cf7

컨테이너 목록 확인 (podman ps)

$ podman ps -a
CONTAINER ID  IMAGE                          COMMAND  CREATED        STATUS            PORTS                   NAMES
e6c290e84bc7  docker.io/jenkins/jenkins:lts           9 seconds ago  Up 6 seconds ago  0.0.0.0:8080->8080/tcp  jenkins

컨테이너 구동 확인 (podman logs)

$ podman logs -f jenkins
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2020-02-26 05:47:25.863+0000 [id=1]     INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @607ms to org.eclipse.jetty.util.log.JavaUtilLog
2020-02-26 05:47:26.064+0000 [id=1]     INFO    winstone.Logger#logInternal: Beginning extraction from war file
2020-02-26 05:47:27.939+0000 [id=1]     WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2020-02-26 05:47:28.015+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T00:04:53.875Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_242-b08
2020-02-26 05:47:28.472+0000 [id=1]     INFO    o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2020-02-26 05:47:28.563+0000 [id=1]     INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2020-02-26 05:47:28.563+0000 [id=1]     INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2020-02-26 05:47:28.573+0000 [id=1]     INFO    o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 660000ms
2020-02-26 05:47:29.104+0000 [id=1]     INFO    hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2020-02-26 05:47:29.286+0000 [id=1]     INFO    o.e.j.s.handler.ContextHandler#doStart: Started w.@26be6ca7{Jenkins v2.204.2,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2020-02-26 05:47:29.330+0000 [id=1]     INFO    o.e.j.server.AbstractConnector#doStart: Started ServerConnector@19932c16{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2020-02-26 05:47:29.331+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: Started @4075ms
2020-02-26 05:47:29.339+0000 [id=20]    INFO    winstone.Logger#logInternal: Winstone Servlet Engine v4.0 running: controlPort=disabled
2020-02-26 05:47:31.477+0000 [id=27]    INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization
2020-02-26 05:47:31.528+0000 [id=25]    INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2020-02-26 05:47:33.605+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2020-02-26 05:47:33.616+0000 [id=27]    INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
2020-02-26 05:47:33.629+0000 [id=25]    INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2020-02-26 05:47:34.953+0000 [id=25]    INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2020-02-26 05:47:35.023+0000 [id=41]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata
2020-02-26 05:47:35.046+0000 [id=41]    INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2020-02-26 05:47:36.424+0000 [id=25]    INFO    o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@3c0bc9b9: display name [Root WebApplicationContext]; startup date [Wed Feb 26 05:47:36 UTC 2020]; root of context hierarchy
2020-02-26 05:47:36.424+0000 [id=25]    INFO    o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@3c0bc9b9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@5f0d5eea
2020-02-26 05:47:36.439+0000 [id=25]    INFO    o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5f0d5eea: defining beans [authenticationManager]; root of factory hierarchy
2020-02-26 05:47:36.670+0000 [id=25]    INFO    o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@743604fa: display name [Root WebApplicationContext]; startup date [Wed Feb 26 05:47:36 UTC 2020]; root of context hierarchy
2020-02-26 05:47:36.671+0000 [id=25]    INFO    o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@743604fa]: org.springframework.beans.factory.support.DefaultListableBeanFactory@65b145c5
2020-02-26 05:47:36.673+0000 [id=25]    INFO    o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@65b145c5: defining beans [filter,legacy]; root of factory hierarchy
2020-02-26 05:47:37.156+0000 [id=25]    INFO    jenkins.install.SetupWizard#init:

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

b042dc5ab0134525bb141afd5c72e5c9

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

2020-02-26 05:47:49.256+0000 [id=25]    INFO    hudson.model.UpdateSite#updateData: Obtained the latest update center data file for UpdateSource default
2020-02-26 05:47:50.151+0000 [id=25]    INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
2020-02-26 05:47:50.191+0000 [id=19]    INFO    hudson.WebAppMain$3#run: Jenkins is fully up and running
2020-02-26 05:47:53.454+0000 [id=41]    INFO    hudson.model.UpdateSite#updateData: Obtained the latest update center data file for UpdateSource default
2020-02-26 05:47:54.513+0000 [id=41]    INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2020-02-26 05:47:54.514+0000 [id=41]    INFO    hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2020-02-26 05:47:54.517+0000 [id=41]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Download metadata. 19,491 ms

웹 브라우저에서 접속하면 기동된 것을 알 수 있습니다.
jenkins-8080.png

컨테이너 중지 (podman stop)

$ podman stop jenkins
e6c290e84bc721919679f6826e0d3fa1a6e9343111e0523be19c81ab6beb7a6d
$ podman ps -a
CONTAINER ID  IMAGE                          COMMAND  CREATED        STATUS                      PORTS                   NAMES
e6c290e84bc7  docker.io/jenkins/jenkins:lts           5 minutes ago  Exited (143) 4 seconds ago  0.0.0.0:8080->8080/tcp  jenkins

컨테이너 구동 (podman start)

$ podman start jenkins
jenkins
$ podman ps -a
CONTAINER ID  IMAGE                          COMMAND  CREATED        STATUS            PORTS                   NAMES
e6c290e84bc7  docker.io/jenkins/jenkins:lts           6 minutes ago  Up 3 seconds ago  0.0.0.0:8080->8080/tcp  jenkins

컨테이너 재시작 (podman restart)

$ podman restart jenkins
e6c290e84bc721919679f6826e0d3fa1a6e9343111e0523be19c81ab6beb7a6d

$ podman ps -a
CONTAINER ID  IMAGE                          COMMAND  CREATED        STATUS            PORTS                   NAMES
e6c290e84bc7  docker.io/jenkins/jenkins:lts           9 minutes ago  Up 3 seconds ago  0.0.0.0:8080->8080/tcp  jenkins

컨테이너 삭제 (podman rm)

$ podman ps -a
CONTAINER ID  IMAGE                          COMMAND  CREATED         STATUS            PORTS                   NAMES
e6c290e84bc7  docker.io/jenkins/jenkins:lts           31 minutes ago  Up 9 seconds ago  0.0.0.0:8080->8080/tcp  jenkins
$ podman stop jenkins
e6c290e84bc721919679f6826e0d3fa1a6e9343111e0523be19c81ab6beb7a6d
$ podman rm jenkins
e6c290e84bc721919679f6826e0d3fa1a6e9343111e0523be19c81ab6beb7a6d
$ podman ps -a
CONTAINER ID  IMAGE  COMMAND  CREATED  STATUS  PORTS  NAMES

3. Podman 컨테이너 사용법

컨테이너의 프로세스 실행 및 접속 (podman exec)

$ podman exec -it jenkins /bin/bash
jenkins@e6c290e84bc7:/$ whoami
jenkins

컨테이너의 프로세스 확인 (podman top)

$ podman top jenkins
USER      PID   PPID   %CPU    ELAPSED           TTY   TIME   COMMAND
jenkins   1     0      0.000   9m50.320088483s   ?     0s     /sbin/tini -- /usr/local/bin/jenkins.sh
jenkins   6     1      2.880   9m50.320317199s   ?     17s    java -Duser.home=/var/jenkins_home -Djenkins.model.Jenkins.slaveAgentPort=50000 -jar /usr/share/jenkins/jenkins.war
jenkins   11    6      0.000   9m50.320453065s   ?     0s     [jenkins.sh]

컨테이너의 포트 상태 확인 (podman port)

$ podman port jenkins
50000/tcp -> 0.0.0.0:50000
8080/tcp -> 0.0.0.0:8080

컨테이너 내에서 파일 복사 (podman cp)

$ podman cp helloworld.sh jenkins:/var/jenkins_home/
$ podman exec -it jenkins /bin/bash
$ cd /var/jenkins_home
$ ls -al
total 100
drwxr-xr-x 13 jenkins jenkins 4096 Feb 26 06:34 .
drwxr-xr-x 12 root    root    4096 Jan 29 14:30 ..
-rw-------  1 jenkins jenkins   12 Feb 26 06:28 .bash_history
drwxr-xr-x  3 jenkins jenkins 4096 Feb 26 05:47 .cache
drwxr-xr-x  3 jenkins jenkins 4096 Feb 26 05:47 .java
-rw-r--r--  1 jenkins jenkins    0 Feb 26 06:19 .lastStarted
-rw-r--r--  1 jenkins jenkins 1643 Feb 26 06:19 config.xml
-rw-r--r--  1 jenkins jenkins  300 Feb 26 06:19 copy_reference_file.log
-rw-rw-r--  1 jenkins jenkins    0 Feb 26 06:33 helloworld.sh
-rw-r--r--  1 jenkins jenkins  156 Feb 26 06:19 hudson.model.UpdateCenter.xml
-rw-------  1 jenkins jenkins 1712 Feb 26 05:47 identity.key.enc
-rw-r--r--  1 jenkins jenkins    7 Feb 26 05:47 jenkins.install.UpgradeWizard.state
-rw-r--r--  1 jenkins jenkins  171 Feb 26 05:47 jenkins.telemetry.Correlator.xml
drwxr-xr-x  2 jenkins jenkins 4096 Feb 26 05:47 jobs
drwxr-xr-x  3 jenkins jenkins 4096 Feb 26 05:47 logs
-rw-r--r--  1 jenkins jenkins  907 Feb 26 06:19 nodeMonitors.xml
drwxr-xr-x  2 jenkins jenkins 4096 Feb 26 05:47 nodes
drwxr-xr-x  2 jenkins jenkins 4096 Feb 26 05:47 plugins
-rw-r--r--  1 jenkins jenkins  129 Feb 26 06:18 queue.xml.bak
-rw-r--r--  1 jenkins jenkins   64 Feb 26 05:47 secret.key
-rw-r--r--  1 jenkins jenkins    0 Feb 26 05:47 secret.key.not-so-secret
drwx------  4 jenkins jenkins 4096 Feb 26 05:47 secrets
-rw-rw-r--  1 root    root    7152 Jan 29 14:29 tini_pub.gpg
drwxr-xr-x  2 jenkins jenkins 4096 Feb 26 05:47 updates
drwxr-xr-x  2 jenkins jenkins 4096 Feb 26 05:47 userContent
drwxr-xr-x  3 jenkins jenkins 4096 Feb 26 05:47 users
drwxr-xr-x 11 jenkins jenkins 4096 Feb 26 05:47 war

맺음말

Podman는 Docker와 매우 유사합니다.
RHEL8 과 CentOS8에서 Docker 대신 Podman을 채택했다고 하니 미리 사용해보는 것도 좋을듯 합니다.

참고

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1