1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| # 1. 首先进入容器内部 docker exec -it emby /bin/sh
# 2. 查看emby服务使用哪个用户执行的,可以看到emby是由bin用户执行的 /# ps ps -ef PID USER TIME COMMAND 1 root 0:00 s6-svscan -t0 /var/run/s6/services 32 root 0:00 s6-supervise s6-fdholderd 171 root 0:00 s6-supervise emby-server 174 root 0:00 sh ./run 196 bin 0:14 /system/EmbyServer -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
# 3. 回到宿主机,查看镜像看为啥使用bin执行呢 docker image inspect lovechen/embyserver
#4. 结果太多我就不全部粘贴了,在Env下面可以看到镜像指定了 UID=2,GID=2,而2在我的系统里就是用户bin "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=en_US.UTF-8", "HOME=/tmp", "AMDGPU_IDS=/share/libdrm/amdgpu.ids", "FONTCONFIG_PATH=/etc/fonts", "LD_LIBRARY_PATH=/lib:/system", "LIBVA_DRIVERS_PATH=/lib/dri", "OCL_ICD_VENDORS=/etc/OpenCL/vendors", "PCI_IDS_PATH=/share/hwdata/pci.ids", "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt", "UID=2", "GID=2", "GIDLIST=2", "NVIDIA_VISIBLE_DEVICES=all", "NVIDIA_DRIVER_CAPABILITIES=compute,video,utility", "XDG_CACHE_HOME=/config/cache" ],
|