Install vscode (visual studio code) as a separate docker container

Text Oh that I wish it was… (honestly it only hurts when I laugh)… :upside_down_face:

Quick background: While not a total noob, I am relatively new to HA & totally new to the VS CodeServer. I was an Engineer for over 20 years (12 at Apple if that matters) so I certainly understand dev concepts/various languages/etc, and have been playing around with Docker on and off now for about a year and change…

With that out of the way.

I tried to add the linuxserver/code-server to my existing Docker compose instance (with minor adaptations as needed for local environment). Unfortunately after nearly 7 days at this I have made only a bit of progress.

Issue(s):

  1. At one point I SORT of got stecky’s DockerMod to run… I say sort of because I got a bunch of errors (likely some of the extensions didn’t load or persist, BUT was able to edit HA files in vscode).

  2. Building on my sketchy knowledge docker (it seems…) I concluded that in keeping with Docker ideology the best approach was to nuke&pave. Delete the vscode config directory and re-create the container after checking my compose script. Unfortunately I can’t get the docker_mod to ever run again. I tried adding the 6 mentioned extensions manually but can’t seem to get the HA extension (or perhaps others) to properly load/config. Thus rather then continue to try t fight my way though something someone else has already done… I’m back to trying to get the mod to load/run as intended and REALLY could use some help as I must be missing something stupid here…

The code server DOES come up AND looking thru the logs I can load the linuxserver mod for perl (as a test), but log seems to error on the fetch for Stecky’s mod. UID Specifically claiming

[mod-init] Applying stecky/mods:code-server-home-assistant files to container,
gzip: stdin: not in gzip format,
tar: Child returned status 1,
tar: Error is not recoverable: exiting now,

FYI UID 1011 is the owner of the vscode/config volume (and everything inside).

I’m copying my log and docker compose files in hopes someone can see what I’m missing… Thanks for ANY help you can provide…

PS: wouldn’t mind a hint as well on how to get the vsserver logs to reflect the local time that is clearly present in the docker container as evidenced by stepping into the live container and checking date. Passing localtime as a volume bind doesn’t improve the matter. Both methods show correct pacific time (though log from the container is in UTC)

–Tom

Docker Config

version: '3'
services:

  HomeAssistant:
    container_name: HomeAssistant
    image: homeassistant/home-assistant:latest
    restart: always
    network_mode: host
    ports:
      - "8123:8123"
    environment:
      - PUID=1009
      - TZ=America/Tijuana
    volumes:
      - "/share/CACHEDEV1_DATA/DockerAppData/HomeAssistant/config:/config"
      - "/var/run/docker.sock:/var/run/docker.sock"

#            Visual Studio code editor
  vscode:
    container_name: vscode
    image: linuxserver/code-server:latest
    restart: unless-stopped
    network_mode: host
    ports:
      - "8443:8443"
    environment:
      - PUID=1011
      - PGID=911
      - TZ=America/Tijuana
      - PASSWORD=XXXXX 
#        - PROXY_DOMAIN=
#        - SUDO_PASSWORD=xxxx
      - HOMEASSISTANT_URL=http://localhost:8123
      - HOMEASSISTANT_TOKEN=XXXXX
#      - DOCKER_MODS=stecky/mods:code-server-home-assistant
      - DOCKER_MODS=linuxserver/mods:code-server-python3|stecky/mods:code-server-home-assistant
    volumes:
      - "/share/CACHEDEV1_DATA/DockerAppData/VScode/config:/config"
      - "/share/CACHEDEV1_DATA/DockerAppData/HomeAssistant/config:/ha_config"
#      - /etc/localtime:/etc/localtime:ro

– Log to follow / next post –