Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Podman

Podmans

Create Basic Container

podman run -it --name prueba-debian --hostname debi debian
  • '-it' Para terminal interactivo
  • '--name' Nombre de container
  • '--hostname' Hostname dentro de container

Copy File From Host to Container

podman cp /ruta/en/host/mi_archivo.txt name-container:/ruta/destino/

Create User Sudoer in Debian

apt update && apt install -y sudo
useradd -m -s /bin/bash devuser
usermod -aG sudo devuser
echo "devuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
su - devuser

Open a Created Container

# Usuario root (por defecto)
podman exec -it nombre_contenedor bash

# Usuario específico
podman exec -it --user usuario nombre_contenedor bash

# Ejemplo con usuario creado:
podman exec -it --user devuser prueba-debian bash

Gui

x11

 podman run -it --rm \
  -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
  -e DISPLAY=$DISPLAY \
  --security-opt label=type:container_runtime_t \
  --name test \
  debian \
  /bin/bash

Wayland(No probado)

podman run -it --rm \
  -v "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/wayland-0" \
  -e XDG_RUNTIME_DIR=/tmp \
  -e WAYLAND_DISPLAY=wayland-0 \
  --security-opt label=type:container_runtime_t \
  docker.io/library/debian:latest \
  sh -c "apt update && apt install -y weston && weston --socket=wayland-0"

¿Qué hace cada parte?

-v "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/wayland-0"
Monta el socket de Wayland del host en el contenedor.

-e XDG_RUNTIME_DIR=/tmp
Configura el directorio runtime dentro del contenedor.

-e WAYLAND_DISPLAY=wayland-0
Define el nombre del socket Wayland.

--security-opt label=type:container_runtime_t
Política de SELinux segura (mejor que label=disable).

sh -c "..."
Instala solo lo necesario y ejecuta Weston (compositor minimalista).

Containers

podman run -it \
  --name bllsht \
  --hostname fedora \
  -v "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/wayland-0" \
  -e XDG_RUNTIME_DIR=/tmp \
  -e WAYLAND_DISPLAY=wayland-0 \
  --security-opt label=type:container_runtime_t \
  fedora

EN PODMAN DESKTOP

Volumes: /run/user/1000/wayland-1 : /tmp/wayland-0

ENV:

XDG_RUNTIME_DIR : /tmp WAYLAND_DISPLAY : wayland-0 QT_QPA_PLATFORM : wayland

PARA EL DE KEEPASS AGREGAR ESTE ENV