差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:podman [2025/03/14 18:19] – [PODMAN_COMPOSE_WARNING_LOGS 環境変数] ともやんlinux:podman [2025/03/31 06:43] (現在) – [参考文献] ともやん
行 10: 行 10:
 ドキュメント:[[rtd>docs.podman.io/|What is Podman? — Podman documentation]] [[gtr>https://docs.podman.io/|翻訳]]\\ ドキュメント:[[rtd>docs.podman.io/|What is Podman? — Podman documentation]] [[gtr>https://docs.podman.io/|翻訳]]\\
 SDK ドキュメント: [[rtd>podman-py.readthedocs.io/|Podman: Python scripting for Podman services — Podman Python SDK documentation]] [[gtr>https://podman-py.readthedocs.io/|翻訳]]\\ SDK ドキュメント: [[rtd>podman-py.readthedocs.io/|Podman: Python scripting for Podman services — Podman Python SDK documentation]] [[gtr>https://podman-py.readthedocs.io/|翻訳]]\\
 +e-books: [[rhd>e-books/podman-action|Podman in Action | Red Hat Developer]]\\
 +
 ===== インストール ===== ===== インストール =====
 公式: [[https://podman.io/docs/installation|Podman Installation | Podman]] [[gtr>https://podman.io/docs/installation|翻訳]]\\ 公式: [[https://podman.io/docs/installation|Podman Installation | Podman]] [[gtr>https://podman.io/docs/installation|翻訳]]\\
行 257: 行 259:
  
 ==== コンテナ実行 [run] ==== ==== コンテナ実行 [run] ====
 +公式: [[https://docs.podman.io/en/latest/markdown/podman-run.1.html|podman-run — Podman documentation]]\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--help</font>
 +</pre></html></WRAP>
 +<WRAP color_result_hlong><html><pre>
 +Run a command in a new container
 +
 +Description:
 +  Runs a command in a new container from the given image
 +
 +Usage:
 +  podman run [options] IMAGE [COMMAND [ARG...]]
 +
 +Examples:
 +  podman run imageID ls -alF /etc
 +  podman run --network=host imageID dnf -y install java
 +  podman run --volume /var/hostdir:/var/ctrdir -i -t fedora /bin/bash
 +
 +Options:
 +      --add-host strings                         Add a custom host-to-IP mapping (host:ip) (default [])
 +      --annotation stringArray                   Add annotations to container (key=value)
 +      --arch ARCH                                use ARCH instead of the architecture of the machine for choosing images
 +  -a, --attach strings                           Attach to STDIN, STDOUT or STDERR
 +      --authfile string                          Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override
 +      --blkio-weight string                      Block IO weight (relative weight) accepts a weight value between 10 and 1000.
 +      --blkio-weight-device DEVICE_NAME:WEIGHT   Block IO weight (relative device weight, format: DEVICE_NAME:WEIGHT)
 +      --cap-add strings                          Add capabilities to the container
 +      --cap-drop strings                         Drop capabilities from the container
 +      --cgroup-conf strings                      Configure cgroup v2 (key=value)
 +      --cgroup-parent string                     Optional parent cgroup for the container
 +      --cgroupns string                          cgroup namespace to use
 +      --cgroups string                           control container cgroup configuration (&quot;enabled&quot;|&quot;disabled&quot;|&quot;no-conmon&quot;|&quot;split&quot;) (default &quot;enabled&quot;)
 +      --chrootdirs stringArray                   Chroot directories inside the container
 +      --cidfile string                           Write the container ID to the file
 +      --conmon-pidfile string                    Path to the file that will receive the PID of conmon
 +      --cpu-period uint                          Limit the CPU CFS (Completely Fair Scheduler) period
 +      --cpu-quota int                            Limit the CPU CFS (Completely Fair Scheduler) quota
 +      --cpu-rt-period uint                       Limit the CPU real-time period in microseconds
 +      --cpu-rt-runtime int                       Limit the CPU real-time runtime in microseconds
 +  -c, --cpu-shares uint                          CPU shares (relative weight)
 +      --cpus float                               Number of CPUs. The default is 0.000 which means no limit
 +      --cpuset-cpus string                       CPUs in which to allow execution (0-3, 0,1)
 +      --cpuset-mems string                       Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
 +      --decryption-key stringArray               Key needed to decrypt the image (e.g. /path/to/key.pem)
 +  -d, --detach                                   Run container in background and print container ID
 +      --detach-keys [a-Z]                        Override the key sequence for detaching a container. Format is a single character [a-Z] or a comma separated sequence of `ctrl-&lt;value&gt;`, where `&lt;value&gt;` is one of: `a-cf`, `@`, `^`, `[`, `\`, `]`, `^` or `_` (default &quot;ctrl-p,ctrl-q&quot;)
 +      --device stringArray                       Add a host device to the container
 +      --device-cgroup-rule strings               Add a rule to the cgroup allowed devices list
 +      --device-read-bps stringArray              Limit read rate (bytes per second) from a device (e.g. --device-read-bps=/dev/sda:1mb)
 +      --device-read-iops stringArray             Limit read rate (IO per second) from a device (e.g. --device-read-iops=/dev/sda:1000)
 +      --device-write-bps stringArray             Limit write rate (bytes per second) to a device (e.g. --device-write-bps=/dev/sda:1mb)
 +      --device-write-iops stringArray            Limit write rate (IO per second) to a device (e.g. --device-write-iops=/dev/sda:1000)
 +      --disable-content-trust                    This is a Docker specific option and is a NOOP
 +      --dns strings                              Set custom DNS servers
 +      --dns-option strings                       Set custom DNS options
 +      --dns-search strings                       Set custom DNS search domains
 +      --entrypoint string                        Overwrite the default ENTRYPOINT of the image
 +  -e, --env stringArray                          Set environment variables in container (default [PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin])
 +      --env-file stringArray                     Read in a file of environment variables
 +      --env-host                                 Use all current host environment variables in container
 +      --env-merge stringArray                    Preprocess environment variables from image before injecting them into the container
 +      --expose strings                           Expose a port or a range of ports
 +      --gidmap strings                           GID map to use for the user namespace
 +      --gpus strings                             GPU devices to add to the container (&apos;all&apos; to pass all GPUs)
 +      --group-add strings                        Add additional groups to the primary container process. &apos;keep-groups&apos; allows container processes to use supplementary groups.
 +      --group-entry string                       Entry to write to /etc/group
 +      --health-cmd string                        set a healthcheck command for the container (&apos;none&apos; disables the existing healthcheck)
 +      --health-interval string                   set an interval for the healthcheck. (a value of disable results in no automatic timer setup)  (default &quot;30s&quot;)
 +      --health-log-destination string            set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file)  (default &quot;local&quot;)
 +      --health-max-log-count uint                set maximum number of attempts in the HealthCheck log file. (&apos;0&apos; value means an infinite number of attempts in the log file) (default 5)
 +      --health-max-log-size uint                 set maximum length in characters of stored HealthCheck log. (&apos;0&apos; value means an infinite log length) (default 500)
 +      --health-on-failure string                 action to take once the container turns unhealthy (default &quot;none&quot;)
 +      --health-retries uint                      the number of retries allowed before a healthcheck is considered to be unhealthy (default 3)
 +      --health-start-period string               the initialization time needed for a container to bootstrap (default &quot;0s&quot;)
 +      --health-startup-cmd string                Set a startup healthcheck command for the container
 +      --health-startup-interval string           Set an interval for the startup healthcheck.  (default &quot;30s&quot;)
 +      --health-startup-retries uint              Set the maximum number of retries before the startup healthcheck will restart the container
 +      --health-startup-success uint              Set the number of consecutive successes before the startup healthcheck is marked as successful and the normal healthcheck begins (0 indicates any success will start the regular healthcheck)
 +      --health-startup-timeout string            Set the maximum amount of time that the startup healthcheck may take before it is considered failed (default &quot;30s&quot;)
 +      --health-timeout string                    the maximum time allowed to complete the healthcheck before an interval is considered failed (default &quot;30s&quot;)
 +      --help                                     
 +  -h, --hostname string                          Set container hostname
 +      --hosts-file string                        Base file to create the /etc/hosts file inside the container, or one of the special values. (&quot;image&quot;|&quot;none&quot;)
 +      --hostuser strings                         Host user account to add to /etc/passwd within container
 +      --http-proxy                               Set proxy environment variables in the container based on the host proxy vars (default true)
 +      --image-volume string                      Tells podman how to handle the builtin image volumes (&quot;bind&quot;|&quot;tmpfs&quot;|&quot;ignore&quot;) (default &quot;anonymous&quot;)
 +      --init                                     Run an init binary inside the container that forwards signals and reaps processes
 +      --init-path string                         Path to the container-init binary
 +  -i, --interactive                              Make STDIN available to the contained process
 +      --ip string                                Specify a static IPv4 address for the container
 +      --ip6 string                               Specify a static IPv6 address for the container
 +      --ipc string                               IPC namespace to use
 +  -l, --label stringArray                        Set metadata on container
 +      --label-file stringArray                   Read in a line delimited file of labels
 +      --log-driver string                        Logging driver for the container (default &quot;journald&quot;)
 +      --log-opt stringArray                      Logging driver options
 +      --mac-address string                       Container MAC address (e.g. 92:d0:c6:0a:29:33)
 +  -m, --memory &lt;number&gt;[&lt;unit&gt;                 Memory limit (format: &lt;number&gt;[&lt;unit&gt;], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes))
 +      --memory-reservation &lt;number&gt;[&lt;unit&gt;     Memory soft limit (format: &lt;number&gt;[&lt;unit&gt;], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes))
 +      --memory-swap string                       Swap limit equal to memory plus swap: &apos;-1&apos; to enable unlimited swap
 +      --memory-swappiness int                    Tune container memory swappiness (0 to 100, or -1 for system default) (default -1)
 +      --mount stringArray                        Attach a filesystem mount to the container
 +      --name string                              Assign a name to the container
 +      --network stringArray                      Connect a container to a network
 +      --network-alias strings                    Add network-scoped alias for the container
 +      --no-healthcheck                           Disable healthchecks on container
 +      --no-hostname                              Do not create /etc/hostname within the container, instead use the version from the image
 +      --no-hosts                                 Do not create /etc/hosts within the container, instead use the version from the image
 +      --oom-kill-disable                         Disable OOM Killer
 +      --oom-score-adj int                        Tune the host&apos;s OOM preferences (-1000 to 1000)
 +      --os OS                                    use OS instead of the running OS for choosing images
 +      --passwd                                   add entries to /etc/passwd and /etc/group (default true)
 +      --passwd-entry string                      Entry to write to /etc/passwd
 +      --personality string                       Configure execution domain using personality (e.g., LINUX/LINUX32)
 +      --pid string                               PID namespace to use
 +      --pidfile string                           Write the container process ID to the file
 +      --pids-limit int                           Tune container pids limit (set -1 for unlimited) (default 2048)
 +      --platform string                          Specify the platform for selecting the image.  (Conflicts with --arch and --os)
 +      --pod string                               Run container in an existing pod
 +      --pod-id-file string                       Read the pod ID from the file
 +      --preserve-fd uints                        Pass a file descriptor into the container (default [])
 +      --preserve-fds uint                        Pass a number of additional file descriptors into the container
 +      --privileged                               Give extended privileges to container
 +  -p, --publish strings                          Publish a container&apos;s port, or a range of ports, to the host (default [])
 +  -P, --publish-all                              Publish all exposed ports to random ports on the host interface
 +      --pull string                              Pull image policy (&quot;always&quot;|&quot;missing&quot;|&quot;never&quot;|&quot;newer&quot;) (default &quot;missing&quot;)
 +  -q, --quiet                                    Suppress output information when pulling images
 +      --rdt-class string                         Class of Service (COS) that the container should be assigned to
 +      --read-only                                Make containers root filesystem read-only
 +      --read-only-tmpfs                          When running --read-only containers mount read-write tmpfs on /dev, /dev/shm, /run, /tmp and /var/tmp (default true)
 +      --replace                                  If a container with the same name exists, replace it
 +      --requires strings                         Add one or more requirement containers that must be started before this container will start
 +      --restart string                           Restart policy to apply when a container exits (&quot;always&quot;|&quot;no&quot;|&quot;never&quot;|&quot;on-failure&quot;|&quot;unless-stopped&quot;)
 +      --retry uint                               number of times to retry in case of failure when performing pull (default 3)
 +      --retry-delay string                       delay between retries in case of pull failures
 +      --rm                                       Remove container and any anonymous unnamed volume associated with the container after exit
 +      --rmi                                      Remove image unless used by other containers, implies --rm
 +      --rootfs                                   The first argument is not an image but the rootfs to the exploded container
 +      --sdnotify string                          control sd-notify behavior (&quot;container&quot;|&quot;conmon&quot;|&quot;healthy&quot;|&quot;ignore&quot;) (default &quot;container&quot;)
 +      --seccomp-policy string                    Policy for selecting a seccomp profile (experimental) (default &quot;default&quot;)
 +      --secret stringArray                       Add secret to container
 +      --security-opt stringArray                 Security Options
 +      --shm-size &lt;number&gt;[&lt;unit&gt;               Size of /dev/shm (format: &lt;number&gt;[&lt;unit&gt;], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes)) (default &quot;65536k&quot;)
 +      --shm-size-systemd &lt;number&gt;[&lt;unit&gt;       Size of systemd specific tmpfs mounts (/run, /run/lock) (format: &lt;number&gt;[&lt;unit&gt;], where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes))
 +      --sig-proxy                                Proxy received signals to the process (default true)
 +      --stop-signal string                       Signal to stop a container. Default is SIGTERM
 +      --stop-timeout uint                        Timeout (in seconds) that containers stopped by user command have to exit. If exceeded, the container will be forcibly stopped via SIGKILL. (default 10)
 +      --subgidname string                        Name of range listed in /etc/subgid for use in user namespace
 +      --subuidname string                        Name of range listed in /etc/subuid for use in user namespace
 +      --sysctl strings                           Sysctl options
 +      --systemd string                           Run container in systemd mode (&quot;true&quot;|&quot;false&quot;|&quot;always&quot;) (default &quot;true&quot;)
 +      --timeout uint                             Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires.
 +      --tls-verify                               Require HTTPS and verify certificates when contacting registries for pulling images
 +      --tmpfs tmpfs                              Mount a temporary filesystem (tmpfs) into a container
 +  -t, --tty                                      Allocate a pseudo-TTY for container
 +      --tz string                                Set timezone in container
 +      --uidmap strings                           UID map to use for the user namespace
 +      --ulimit strings                           Ulimit options
 +      --umask string                             Set umask in container (default &quot;0022&quot;)
 +      --unsetenv stringArray                     Unset environment default variables in container
 +      --unsetenv-all                             Unset all default environment variables in container
 +  -u, --user string                              Username or UID (format: &lt;name|uid&gt;[:&lt;group|gid&gt;])
 +      --userns string                            User namespace to use
 +      --uts string                               UTS namespace to use
 +      --variant VARIANT                          Use VARIANT instead of the running architecture variant for choosing images
 +  -v, --volume stringArray                       Bind mount a volume into the container
 +      --volumes-from stringArray                 Mount volumes from the specified container(s)
 +  -w, --workdir string                           Working directory inside the container
 +
 +</pre></html></WRAP>
 +</WRAP>
 +
 +=== コンテナを実行したままにするには...🤔 [-t, --tty] ===
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-t</font> <font color="#A347BA">-d</font> tomoyan596/fedora41-minimal-zsh
 +</pre></html></WRAP>
 +Or
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">--tty</font> <font color="#A347BA">--detach</font> tomoyan596/fedora41-minimal-zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +1933208711c485d1e0b63ba3409763fe94771e10f8fee50d8995ed5a115a1bd5
 +</pre></html></WRAP>
 +</WRAP>
 +
 +起動から 4 分経過後...😉\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> ps
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +CONTAINER ID  IMAGE                                             COMMAND     CREATED        STATUS        PORTS                                                                                                           NAMES
 +200c9b8ac531  localhost/tomoyannet_litespeed:latest                         8 days ago     Up 13 hours   0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp, 0.0.0.0:7080-&gt;7080/tcp, 0.0.0.0:8088-&gt;8088/tcp, 0.0.0.0:443-&gt;443/udp  litespeed
 +1933208711c4  localhost/tomoyan596/fedora41-minimal-zsh:latest  zsh         <b class=DiYE>4 minutes ago  Up 4 minutes</b>                                                                                                                  fedora
 +</pre></html></WRAP>
 +</WRAP>
 +
 +コンテナに入る🤔\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> exec <font color="#A347BA">-ti</font> fedora zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +<font color="#12488B">┌──(</font><font color="#F66151"><b>root💀1933208711c4</b></font>)-[<b>~</b><font color="#12488B">]</font>
 +<font color="#12488B">└─</font><font color="#F66151"><b>#</b></font>
 +</pre></html></WRAP>
 +</WRAP>
 +
 +コンテナを終了するには...🤔\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> kill fedora                                                           
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +fedora
 +</pre></html></WRAP>
 +</WRAP>
 +
 +=== コンテナを実行しシェルに入るには...🤔 [-i, --interactive] ===
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +Or
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">--tty</font> <font color="#A347BA">--interactive</font> tomoyan596/fedora41-minimal-zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +<font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 23b4e150d685</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font>
 +<font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font>
 +</pre></html></WRAP>
 +</WRAP>
 +
 +=== コンテナ内のカラーが微妙に違う...🤔ドウデモイイケドネ...😅 ===
 +気になる人のために...😉\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">buildah</font> u<font color="#999999">nshare</font>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +<font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 highway-x</b></font><font color="#5F00FF">)-[</font><b>~/</b><font color="#5F00FF">]</font>
 +<font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font>
 +</pre></html></WRAP>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +┌──(<font color="#F66151"><b>root 💀 dedcd1106d29</b></font>)-[<b>~</b>]
 +└─<font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font>
 +</pre></html></WRAP>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=$TERM&quot;</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +<font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font>
 +<font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font>
 +</pre></html></WRAP>
 +Or
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=xterm-256color&quot;</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +<font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font>
 +<font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font>
 +</pre></html></WRAP>
 +</WRAP>
 +※''$TERM'' 環境変数は通常 VTE によって設定されるが、''podman run'' または ''podman exec'' では今のところ設定されない🤔\\
 +
 +''$LS_COLORS'' は特に差異は認められない😊\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">icdiff</font> <font color="#A347BA">&lt;</font><font color="#2A7BDE"><b>(</b></font><font color="#26A269">echo</font> $LS_COLORS<font color="#2A7BDE"><b>)</b></font> <font color="#A347BA">&lt;</font><font color="#2A7BDE"><b>(</b></font><font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> tomoyan596/fedora41-minimal-zsh echo $LS_COLORS<font color="#2A7BDE"><b>)</b></font>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +<font color="#12488B">/proc/self/fd/11</font>                                         <font color="#12488B">/proc/self/fd/12</font>
 +</pre></html></WRAP>
 +</WRAP>
 +
 +一先ず ''-e "TERM=$TERM"'' で運用😅\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt tomoyan596/openwrt_builder zsh 
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +┌──(<b>tomoyan   d72536ea41c9</b>)-[<b>~</b>]
 +└─<b>$</b> <font color="#26A269">exit</font>
 +</pre></html></WRAP>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=</font><font color="#A347BA">$TERM</font><font color="#A2734C">&quot;</font> tomoyan596/openwrt_builder zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 +<font color="#00FFFF">┌──(</font><font color="#0087FF"><b>tomoyan   f300a11c5dff</b></font><font color="#00FFFF">)-[</font><b>~</b><font color="#00FFFF">]</font>
 +<font color="#00FFFF">└─</font><font color="#0087FF"><b>$</b></font> 
 +</pre></html></WRAP>
 +</WRAP>
 +
 +**参考文献:**\\
 +[[https://www.baeldung.com/linux/docker-container-colored-bash-output|Displaying Colored Output in Bash Inside a Docker Container | Baeldung on Linux]]\\
 +[[https://forums.docker.com/t/wrong-colors-inside-docker-container/68322|Wrong colors inside Docker container - General - Docker Community Forums]]\\
 +[[https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/|How to Change the Colors of Directories and Files in the ls Command]] [[gtr>https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/|翻訳]]\\
 +[[https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/|BASH Shell Change The Color of Shell Prompt on Linux or UNIX - nixCraft]]\\
 +[[https://superuser.com/questions/841016/how-to-configure-gnome-terminal-to-use-xterm-256color-by-default|linux - How to configure gnome-terminal to use xterm-256color by default? - Super User]]\\
 +[[https://askubuntu.com/questions/233280/gnome-terminal-reports-term-to-be-xterm/578798|Gnome-Terminal reports $TERM to be `xterm` - Ask Ubuntu]] [[gtr>https://askubuntu.com/questions/233280/gnome-terminal-reports-term-to-be-xterm/578798|翻訳]]\\
 +
 +=== 実行例 ===
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 706: 行 1015:
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_mincode><html><pre> <WRAP color_mincode><html><pre>
 +<font color="#7C7865"># podman</font>
 <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_PROVIDER</font><font color="#F92672">=</font><font color="#E6DB74">podman-compose</font> <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_PROVIDER</font><font color="#F92672">=</font><font color="#E6DB74">podman-compose</font>
 <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_WARNING_LOGS</font><font color="#F92672">=</font><font color="#E6DB74">false</font> <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_WARNING_LOGS</font><font color="#F92672">=</font><font color="#E6DB74">false</font>
 +<font color="#F92672">export</font><font color="#FFFFFF"> DOCKER_HOST</font><font color="#F92672">=</font><font color="#E6DB74">unix://</font><font color="#FFFFFF">$XDG_RUNTIME_DIR</font><font color="#E6DB74">/podman/podman.sock</font>
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 720: 行 1031:
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_mincode><html><pre> <WRAP color_mincode><html><pre>
 +<font color="#7C7865"># podman</font>
 <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_PROVIDER</font><font color="#F92672">=</font><font color="#E6DB74">podman-compose</font> <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_PROVIDER</font><font color="#F92672">=</font><font color="#E6DB74">podman-compose</font>
 <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_WARNING_LOGS</font><font color="#F92672">=</font><font color="#E6DB74">false</font> <font color="#F92672">export</font><font color="#FFFFFF"> PODMAN_COMPOSE_WARNING_LOGS</font><font color="#F92672">=</font><font color="#E6DB74">false</font>
 +<font color="#F92672">export</font><font color="#FFFFFF"> DOCKER_HOST</font><font color="#F92672">=</font><font color="#E6DB74">unix://</font><font color="#FFFFFF">$XDG_RUNTIME_DIR</font><font color="#E6DB74">/podman/podman.sock</font>
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 895: 行 1208:
 ==== podman compose を systemd で実行する🤔 ==== ==== podman compose を systemd で実行する🤔 ====
 podman compose には、systemd の unit ファイルを生成する機能がある🤔\\ podman compose には、systemd の unit ファイルを生成する機能がある🤔\\
 +
 +<WRAP round important 90%>
 ⚠ docker compose では、このオプションが存在しない😢\\ ⚠ docker compose では、このオプションが存在しない😢\\
 <WRAP color_term> <WRAP color_term>
行 908: 行 1223:
                         create systemd unit file or register compose stack to it                         create systemd unit file or register compose stack to it
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
 +
 </WRAP> </WRAP>
  
行 6763: 行 7080:
 [[https://www.redhat.com/sysadmin/speeding-container-buildah|Speeding up container image builds with Buildah | Enable Sysadmin]]\\ [[https://www.redhat.com/sysadmin/speeding-container-buildah|Speeding up container image builds with Buildah | Enable Sysadmin]]\\
 [[https://stackoverflow.com/questions/57776452/is-it-possible-to-map-a-user-inside-the-docker-container-to-an-outside-user|linux - Is it possible to map a user inside the docker container to an outside user? - Stack Overflow]]\\ [[https://stackoverflow.com/questions/57776452/is-it-possible-to-map-a-user-inside-the-docker-container-to-an-outside-user|linux - Is it possible to map a user inside the docker container to an outside user? - Stack Overflow]]\\
 +[[https://kinsta.com/blog/dockerfile-entrypoint/|Dockerfile ENTRYPOINT: Everything You Need To Know]]\\
  
 ==== 付録 ==== ==== 付録 ====
  • linux/podman.1741943965.txt.gz
  • 最終更新: 2025/03/14 18:19
  • by ともやん