Files

3.1 KiB

display_name, description, icon, maintainer_github, verified, tags
display_name description icon maintainer_github verified tags
Java Development Workspace Docker workspace for Java development with SDKMAN, a Temurin JDK, Maven, and Claude Code. /icon/java.svg sirblob false
docker
container
gpu
java
maven
sdkman
claude
ollama

Java Development Workspace

Docker workspace for Java development with SDKMAN, a Temurin JDK, Maven, and Claude Code.

Provisions a Docker container as a Coder workspace with selectable GPU passthrough, Docker-out-of-Docker, and a persistent home directory.

Preinstalled tools

  • SDKMAN! at /opt/sdkman, for switching JDK and Maven versions
  • Temurin JDK 21
  • Maven 3.9
  • Claude Code
  • Docker CLI for Docker-out-of-Docker
  • Gitea CLI (tea)
  • code-server and JetBrains Toolbox support

Parameters

Parameter Description Default
GPU Assignment Which GPU(s) to attach: GPU 0, GPU 1, or both. GPU 1 is shared with the Ollama and Immich stacks. GPU 0

Prerequisites

The host needs the NVIDIA container toolkit for GPU passthrough. Coder itself runs as a container and creates workspaces through the host's Docker socket, so its service needs the socket mounted and the host docker group added:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock
group_add:
  - "987"

Workspaces get the same GID through the docker_group_id template variable, which defaults to 987. Confirm the host GID with getent group docker and override the variable if it differs.

Ollama

OLLAMA_HOST is preset to http://host.docker.internal:11434. Verify with:

curl "$OLLAMA_HOST/api/tags"

Gitea

The tea CLI manages repositories, issues, and pull requests from the workspace:

tea login add --name sirblob --url https://git.sirblob.co --token <token>
tea repos list

Docker-out-of-Docker lets you build and push images to the registry:

docker login git.sirblob.co -u <user> -p <token>
docker build -t git.sirblob.co/<user>/<image>:<tag> .
docker push git.sirblob.co/<user>/<image>:<tag>

Switching JDK versions

/etc/profile.d/sdkman.sh initialises SDKMAN! for login shells. In a shell that did not pick it up, source it directly:

source /opt/sdkman/bin/sdkman-init.sh
sdk list java
sdk install java 17.0.12-tem

Updates

The image is built with the base packages already upgraded, and the agent runs apt-get update and apt-get upgrade on every workspace start so a long-lived container keeps picking up security updates.

Persistence

/home/coder is mapped to a host directory and survives workspace restarts. The rest of the root filesystem is ephemeral, so every preinstalled tool lives under /opt or /usr/local instead of the home directory.

Files

File Contents
main.tf Providers, data sources, and shared locals
parameters.tf Workspace parameters
agent.tf Coder agent, startup script, and metadata
apps.tf code-server and JetBrains modules
container.tf Docker image build and container resource
Dockerfile Workspace image