linuxserver / docker-code-server

GNU General Public License v3.0
1.63k stars 327 forks source link

[BUG] Using command: in compose.yaml makes the container crashes #176

Closed SelimGOZ closed 6 months ago

SelimGOZ commented 6 months ago

Is there an existing issue for this?

Current Behavior

Everytime i use the command: apt update && apt install python3 wget pyhton3-pip or any other command it stops itself as soon as one part is done.

Expected Behavior

It should run all commands perfectly with no crashes the way ut does in on the web server terminal

Steps To Reproduce

  1. Add the compose file
  2. At the bottom put command: apt update && apt install python3 wget python3-pip
  3. docker compose up

Environment

- OS: Ubuntu Server 23.10
- How docker service was installed: using docker apt install tutorial from https://docs.docker.com/engine/install/ubuntu/

CPU architecture

x86-64

Docker creation

---
version: "3.9"

services:
  code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=ETC/UTC
      - PASSWORD=cba
      - HASHED_PASSWORD=
      - SUDO_PASSWORD=abc
      - SUDO_PASSWORD_HASHED=
      - DEFAULT_WORKSPACE=/config/workspace
     ports:
       - "8443:8443"
     volumes:
       - /root/docker/code-server/config:/config
       - type: bind
         source: /root/docker/code-server/sudoers
         target: /etc/sudoers
     command: apt update $$ apt install python3 wget python3-pip

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
setting up sudo access
adding abc to sudoers
setting sudo password using SUDO_PASSWORD env var
New password: Retype new password: passwd: password updated successfully
[custom-init] No custom files found, skipping...
[2024-03-17T16:02:14.331Z] info  code-server 4.22.1 760d1318e98945d05133c6121f99541ca7a39bf8
[2024-03-17T16:02:14.331Z] info  Using user-data-dir /config/data
[2024-03-17T16:02:14.338Z] info  Using config file /config/.config/code-server/config.yaml
[2024-03-17T16:02:14.338Z] info  HTTP server listening on http://0.0.0.0:8443/
[2024-03-17T16:02:14.338Z] info    - Authentication is enabled
[2024-03-17T16:02:14.338Z] info      - Using password from $PASSWORD
[2024-03-17T16:02:14.338Z] info    - Not serving HTTPS
[2024-03-17T16:02:14.338Z] info  Session server listening on /config/data/code-server-ipc.sock
[ls.io-init] done.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main Sources [1668 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/universe Sources [22.0 MB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/multiverse Sources [361 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/restricted Sources [28.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Sources [71.0 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/universe Sources [405 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Sources [21.8 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main Sources [602 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1353 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1848 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1998 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [50.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-security/restricted Sources [67.0 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-security/universe Sources [234 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-security/multiverse Sources [12.1 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy-security/main Sources [323 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1079 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.6 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1961 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1569 kB]
Fetched 55.9 MB in 4s (14.1 MB/s)
Reading package lists...
Building dependency tree...
Reading state information...
24 packages can be upgraded. Run 'apt list --upgradable' to see them.
github-actions[bot] commented 6 months ago

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

Roxedus commented 6 months ago

We do not support, or advertise the use of the command directive. https://www.linuxserver.io/blog/2019-09-14-customizing-our-containers