- Initial release.

This commit is contained in:
Arnaud G. GIBERT 2024-08-23 11:44:27 +02:00
commit d44356cf33
8 changed files with 171 additions and 0 deletions

11
.env Normal file
View File

@ -0,0 +1,11 @@
# Rx3 X11 Pulse Mageia-9 Docker Image
#-------------------------------------------------------------------------------
IMG_NAME="x11-pulse-mga9"
IMG_FULL_NAME="Rx3 X11 Pulse Mageia-9 Docker Image"
IMG_VERSION="1.0.0"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
# To be difines at run time
USER_ID=""
APPL_HOME_DIR=""

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
*.old

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# Rx3 X11 Pulse Mageia-9 Docker Image
#-------------------------------------------------------------------------------
FROM docker.xor.rx3:5000/rx3/base-mga9:1.2.0
ARG IMG_NAME
ARG IMG_FULL_NAME
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ENV DISPLAY=:0
RUN urpmi --force xterm lib64jack0 lib64opencl1 pipewire-media-session lib64proxy-webkit hunspell-en lib64xcb-xkb1 lib64xcomposite1 lib64xcursor1 lib64xdamage1 lib64xft-gir2.0 lib64xi6 lib64xinerama1 lib64xkbcommon0 lib64vulkan-loader1 lib64xlib-gir2.0 lib64xrandr2 lib64xmlb2 lib64xslt1 libexif12-common libgxps-tools frozen-bubble emacs
COPY /sbin/user_add_exec /sbin
VOLUME /home
VOLUME /tmp/.X11-unix/X0
VOLUME /run/user
CMD ["/bin/bash"]
ENTRYPOINT []

23
ReadMe.txt Normal file
View File

@ -0,0 +1,23 @@
Welcome to X11-Pulse-Mga9 docker image!
This is project aims to build a X11 + Pulse + Mageia-9 docker image able to run any graphic & audio application isolated.
Features:
- Curtently based on base-mga9:1.2.0 image,
- X11 & Pulse base libraries installed,
- user_add_exec program to create on the run the user environement.
Usage:
./run.sh <Application Dir> <Application Exec>
Enjoy it!
Your Rx3 Team.
--
arnaud@rx3.net
https://git.rx3.org/gitea/rx3/x11-pulse-mga9

8
ReleaseNotes.txt Normal file
View File

@ -0,0 +1,8 @@
------------------------------------------------------------------------------------------------------------------------------------
X11-Pulse-Mga9 V 1.0.0 - A. GIBERT - 2024/08/23
------------------------------------------------------------------------------------------------------------------------------------
- Initial release,
- Use based on base-mga9:1.2.0 image,
- X11 & Pulse ready,
- user_add_exec installed.

40
compose.yaml Normal file
View File

@ -0,0 +1,40 @@
# Rx3 X11 Pulse Mageia-9 Docker Image
#-------------------------------------------------------------------------------
name: ${IMG_NAME}
services:
default:
container_name: ${IMG_NAME}
image: docker.xor.rx3:5000/rx3/${IMG_NAME}:${IMG_VERSION}
build:
context: .
args:
- IMG_NAME=${IMG_NAME}
- IMG_FULL_NAME=${IMG_FULL_NAME}
- IMG_VERSION=${IMG_VERSION}
- IMG_MAINTAINER=${IMG_MAINTAINER}
restart: unless-stopped
environment:
- DISPLAY=:0
volumes:
- home_dir:/home
- type: bind
source: /tmp/.X11-unix/X0
target: /tmp/.X11-unix/X0
- type: bind
source: /run/user/${USER_ID}/pulse
target: /run/user/${USER_ID}/pulse
- type: bind
source: ${APPL_HOME_DIR}
target: ${APPL_HOME_DIR}
network_mode: bridge
volumes:
home_dir:
external: true

16
run.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
export APPL_HOME_DIR="$1"
shift
export APPL_NAME="$1"
shift
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
export GROUP_NAME=$(id -gn)
docker compose run --rm default /sbin/user_add_exec ${USER_ID} ${USER} ${HOME} ${GROUP_ID} ${GROUP_NAME} ${APPL_HOME_DIR}/${APPL_NAME} $*

42
sbin/user_add_exec Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
for arg in User_Id User_Name Home_Dir Group_Id Group_Name
do
declare "$arg"=$1
shift
done
echo "User Add & Exec: User_Id: (${User_Id}) User_Name: [${User_Name}] Home_Dir: [${Home_Dir}] Group_Id: (${Group_Id}) Group_Name: [${Group_Name}]"
echo " Display: [${DISPLAY}] Cmd: [${*}]"
echo ""
echo "Creating group..."
groupadd --gid ${Group_Id} ${Group_Name}
echo "Creating user..."
if [[ ! -d ${Home_Dir} ]]
then
home_opts="--create-home"
fi
useradd 2>/dev/null --uid ${User_Id} --gid ${Group_Id} -m --home-dir ${Home_Dir} ${home_opts} --password "" ${User_Name}
echo "Update global profile..."
echo -e "export DISPLAY=${DISPLAY}\nexport XDG_RUNTIME_DIR=/run/user/${User_Id}" >/etc/profile.d/x11.sh
chown ${User_Name}:${Group_Name} /run/user/${User_Id}
echo "Exec Cmd..."
su - -P ${User_Name} -c $*
echo "Completed!"