This repository contains a Dockerfile for a development container based on ubuntu:24.04 with:
- TeX Live (installed from the official
install-tl-unx.tar.gzinstaller) - OpenSSH server (
sshd) for remote shell access code-server(VS Code in browser)- A preconfigured non-root user with
sudoaccess - hub.docker.com: https://hub.docker.com/repository/docker/rusdmv/texlive-ssh-code
- Base image:
ubuntu:24.04 - Core tools:
bash,curl,wget,git,tar,perl,xz-utils,ca-certificates - Admin:
sudo - SSH:
openssh-server - Editor server:
code-server - Preinstalled code-server extension:
James-Yu.latex-workshop(LaTeX Workshop) - TeX distribution: TeX Live +
tlmgr update --selfandtlmgr update --all - Project workspace volume:
/workspace/tex-projects
SSH_USERNAME(default:tex)- Linux user created for SSH and
sudo
- Linux user created for SSH and
SSH_PASSWORD(default:password)- Password set for
SSH_USERNAMEand used bycode-server
- Password set for
Example build with custom args:
docker build \ --build-arg SSH_USERNAME=tex \ --build-arg SSH_PASSWORD=password \ -t texlive-ssh-vscode .code-server uses the same password as SSH_PASSWORD (configured at build time).
Example run:
docker run -d \ --name texlive-ssh-vscode \ -p 2222:22 \ -p 8080:8080 \ -v "$PWD/my-tex-project:/workspace/tex-projects" \ texlive-ssh-vscodeA small compose setup is included in docker-compose.yml.
- Service name:
container - Container name:
texlive-ssh-code - Host project folder:
./my-tex-project - SSH build args:
SSH_USERNAME(defaulttex)SSH_PASSWORD(defaultpassword, also used bycode-server)
Start:
mkdir -p my-tex-project docker compose up -d --buildStop:
docker compose downUse custom SSH credentials for build:
SSH_USERNAME=myuser SSH_PASSWORD=mypassword docker compose up -d --build- Container path:
/workspace/tex-projects - Dockerfile sets:
WORKDIR /workspace/tex-projectsVOLUME ["/workspace/tex-projects"]
code-serverstarts in this directory, so mounted TeX projects are editable immediately.
Example (Linux/macOS):
docker run -d \ --name texlive-ssh-vscode \ -p 2222:22 \ -p 8080:8080 \ -v "$PWD/my-tex-project:/workspace/tex-projects" \ texlive-ssh-vscode- SSH user:
tex - SSH password:
password - SSH port (host):
2222(when mapped as shown above) - code-server URL:
http://localhost:8080 - code-server password: same as SSH password (
SSH_PASSWORD)
SSH login:
ssh tex@localhost -p 2222SSH_USERNAMEis added to thesudogroup.- System changes can be made through
SSH_USERNAMEusingsudo(root privileges via sudo):
sudo whoamiExpected output: root
Container command runs /usr/local/bin/start-sshd.sh, which:
- Creates
/run/sshd - Generates SSH host keys (
ssh-keygen -A) - Starts
code-serveras usertexon0.0.0.0:8080 - Runs
sshdin foreground (/usr/sbin/sshd -D -e)
The image sets:
PasswordAuthentication yesUsePAM yesPermitRootLogin noAllowUsers <SSH_USERNAME>
Important: AllowUsers effectively restricts SSH logins to the configured SSH_USERNAME (default: tex).
TeX Live is installed from:
https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
After installation:
tlmgr update --selftlmgr update --all
TeX binaries are symlinked into /usr/local/bin so tools like pdflatex are available in PATH.
docker build -t texlive-ssh-vscode . docker run -d --name texlive-ssh-vscode -p 2222:22 -p 8080:8080 -v "$PWD/my-tex-project:/workspace/tex-projects" texlive-ssh-vscode ssh tex@localhost -p 2222 id sudo -k && sudo whoamiThen open http://localhost:8080 in a browser.
Default credentials are for development/testing only. For real use:
- Change SSH password
- Set a strong
SSH_PASSWORD - Consider key-based SSH auth instead of password auth
- Consider tightening
sshd_configfor your environment