Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Environment variables are swallowed #15

Closed
1 task done
dragon-dxw opened this issue Nov 14, 2024 · 3 comments
Closed
1 task done

[BUG] Environment variables are swallowed #15

dragon-dxw opened this issue Nov 14, 2024 · 3 comments

Comments

@dragon-dxw
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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
Copy link

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

@thespad
Copy link
Member

thespad commented Nov 14, 2024

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.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@thespad thespad closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants