linuxserver / docker-libreoffice

GNU General Public License v3.0
95 stars 14 forks source link

[BUG] Environment variables are swallowed #15

Open dragon-dxw opened 1 week ago

dragon-dxw commented 1 week ago

Is there an existing issue for this?

Current Behavior

With the following Dockerfile:

FROM lscr.io/linuxserver/libreoffice:7.6.7 AS libreoffice_base
CMD ["bash", "-c", "set"]

environment variables set via docker compose

---
services:
  libreoffice:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: libreoffice
    environment:
      JAM: "cake"
    env_file:
      - ./.env
    volumes:
      - ./data:/data:z
    restart: unless-stopped

neither the environment variables set via .env nor in docker compose appear.

Expected Behavior

Swapping the libreoffice image for debian, the environment variables appear.

Steps To Reproduce

(see current/expected behaviour)

Environment

- How docker service was installed: Mosyle Self Service

CPU architecture

arm64

Docker creation

docker compose up --build

Container logs

██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.3.3 - built Nov  9 2024 19:00:38
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

Openbox-Message: 10:58:37.983: Unable to make directory '/config/.cache/openbox': Permission denied
Openbox-Message: Unable to make directory "/config/.cache/openbox/sessions": Permission denied
[ls.io-init] done.
BB_ASH_VERSION='1.36.1'
FUNCNAME=''
HOSTNAME='d90bd4b01d10'
IFS=' 
'
LINENO=''
OLDPWD='/'
OPTIND='1'
PATH='/command:/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PPID='1'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/'
SHLVL='1'
arg0=''
b=''
cv='0'
etc='/etc'
hook='/docker-mods'
profile=''
prog='/run/s6/basedir/scripts/rc.init'
r='0'
timeout='0'
top='top'
v='1'
Obt-Message: Xinerama extension is not present on the server
tint2: Using glib slice allocator (default). Run tint2 with environment variable G_SLICE=always-malloc in case of strange behavior or crashes
tint2: xShm: Disabled
tint2: No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.
tint2: Loading config file: /config/.config/tint2/tint2rc
tint2: real transparency off.... depth: 24
tint2: panel items: LT
tint2: nb monitors 1, nb monitors used 1, nb desktops 4
tint2: panel 1 uses scale 1 
tint2: Loading icon theme cache...
Icon path not found in cache: theme = hicolor, icon = libreoffice-writer, size = 24
tint2: Loading icon theme 'hicolor': 'hicolor'Xlib:  extension "XINERAMA" missing on display ":1".

Adding icon path to cache: theme = hicolor, icon = libreoffice-writer, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-writer.png
Icon path not found in cache: theme = hicolor, icon = libreoffice-calc, size = 24
Adding icon path to cache: theme = hicolor, icon = libreoffice-calc, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-calc.png
Icon path not found in cache: theme = hicolor, icon = libreoffice-impress, size = 24
Adding icon path to cache: theme = hicolor, icon = libreoffice-impress, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-impress.png
Icon path not found in cache: theme = hicolor, icon = libreoffice-draw, size = 24
Adding icon path to cache: theme = hicolor, icon = libreoffice-draw, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-draw.png
Icon path not found in cache: theme = hicolor, icon = libreoffice-math, size = 24
Adding icon path to cache: theme = hicolor, icon = libreoffice-math, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-math.png
Icon path not found in cache: theme = hicolor, icon = libreoffice-base, size = 24
Adding icon path to cache: theme = hicolor, icon = libreoffice-base, size = 24, path = /usr/share/icons/hicolor/24x24/apps/libreoffice-base.png
Icon path not found in cache: theme = hicolor, icon = org.xfce.thunar, size = 24
X connection to :1 broken (explicit kill or server shutdown).
X connection to :1 broken (explicit kill or server shutdown).
Adding icon path to cache: theme = hicolor, icon = org.xfce.thunar, size = 24, path = /usr/share/icons/hicolor/48x48/apps/org.xfce.thunar.png
Icon path not found in cache: theme = hicolor, icon = xterm-color_48x48, size = 24
Adding icon path to cache: theme = hicolor, icon = xterm-color_48x48, size = 24, path = /usr/share/pixmaps/xterm-color_48x48.xpm
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.3.3 - built Nov  9 2024 19:00:38
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

Openbox-Message: 10:58:41.758: Unable to make directory '/config/.cache/openbox': Permission denied
[ls.io-init] done.
Openbox-Message: Unable to make directory "/config/.cache/openbox/sessions": Permission denied
BB_ASH_VERSION='1.36.1'
FUNCNAME=''
HOSTNAME='d90bd4b01d10'
IFS=' 
'
LINENO=''
OLDPWD='/'
OPTIND='1'
PATH='/command:/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PPID='1'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/'
SHLVL='1'
arg0=''
b=''
cv='0'
etc='/etc'
hook='/docker-mods'
profile=''
prog='/run/s6/basedir/scripts/rc.init'
r='0'
timeout='0'
top='top'
v='1'
Obt-Message: Xinerama extension is not present on the server
XIO:  fatal IO error 2 (No such file or directory) on X server ":1"
      after 765 requests (765 known processed) with 29 events remaining.
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.3.3 - built Nov  9 2024 19:00:38
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

Openbox-Message: Unable to make directory "/config/.cache/openbox/sessions": Permission denied
Openbox-Message: 10:58:45.892: Unable to make directory '/config/.cache/openbox': Permission denied
[ls.io-init] done.
BB_ASH_VERSION='1.36.1'
FUNCNAME=''
HOSTNAME='d90bd4b01d10'
IFS=' 
'
LINENO=''
OLDPWD='/'
OPTIND='1'
PATH='/command:/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PPID='1'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/'
SHLVL='1'
arg0=''
b=''
cv='0'
etc='/etc'
hook='/docker-mods'
profile=''
prog='/run/s6/basedir/scripts/rc.init'
r='0'
timeout='0'
top='top'
v='1'
Obt-Message: Xinerama extension is not present on the server
X connection to :1 broken (explicit kill or server shutdown).
tint2: Using glib slice allocator (default). Run tint2 with environment variable G_SLICE=always-malloc in case of strange behavior or crashes
tint2: could not open display!
Failed to open display
s6-linux-init-shutdown: fatal: unable to talk to shutdownd: Operation not permitted
github-actions[bot] commented 1 week ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

thespad commented 1 week ago

Correct, s6 sandboxes the container environment and by bypassing its init process with your own CMD you also bypass that environment.

This feels extremely X/Y so I would suggest explaining what you're actually trying to achieve rather than just providing random errors and expecting us to guess.