Skip to content

Instantly share code, notes, and snippets.

@DavesCodeMusings
Last active June 1, 2024 21:24
Show Gist options
  • Select an option

  • Save DavesCodeMusings/64fed4b07ab244f426899ea76ee529ce to your computer and use it in GitHub Desktop.

Select an option

Save DavesCodeMusings/64fed4b07ab244f426899ea76ee529ce to your computer and use it in GitHub Desktop.
Cooperative Python on code-server Docker Container
Nothing earth-shattering here. Just extending the linuxserver.io
Docker container for VS Code code-server to have Python support.
This allows you to use run and debug from within code-server.
You'll still need to install extensions the first time though.
For whatever reason, `RUN code-server --install-extension` in the
Dockerfile did not work. It was successful, but extensions were
not available.
---
services:
code-server:
build: .
container_name: code-server
hostname: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=America/Chicago
- DEFAULT_WORKSPACE=/src
volumes:
- config:/config
- /usr/src:/src
ports:
- 8443:8443
restart: unless-stopped
volumes:
config:
FROM lscr.io/linuxserver/code-server:latest
# Add Python support
RUN apt-get update \
&& apt-get install -y \
python3 \
pylint \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment