Skip to content

Instantly share code, notes, and snippets.

@johnoscott
Created January 8, 2026 03:13
Show Gist options
  • Select an option

  • Save johnoscott/62ccd22e3b24d8b7c70450e88b972d9b to your computer and use it in GitHub Desktop.

Select an option

Save johnoscott/62ccd22e3b24d8b7c70450e88b972d9b to your computer and use it in GitHub Desktop.
Dockerfile and Docker Compose VaultSpeed Agent

Define a JDK Docker image

FROM openjdk:11-slim-bullseye  
  
# install:  
# - ca-certificates required by OpenJDK 11  
# - git for VaultSpeed to perform a git deployment  
RUN apt-get update -y && \  
    apt-get dist-upgrade -y && \  
    apt-get install -y --no-install-recommends \  
        git \  
        ca-certificates  
  
RUN update-ca-certificates  
  
# Clean up to reduce the image size  
RUN apt-get clean && \  
   rm -rf /var/lib/apt/lists/*  
  
#  
# vaultspeed user ( with home directory : /home/agent )  
#  
  
RUN useradd \  
    --uid 1001 --gid root --groups sudo \  
    --system --create-home --home-dir /home/agent --shell /bin/bash \  
    vaultspeed  
USER vaultspeed  
  
WORKDIR /home/agent  
  
# WARNING : The agent (vs-agent.jar) is not included in the image, it is expected to be mounted to /home/agent  
#  
CMD echo "[Docker] [OpenJDK11] : Starting VaultSpeed Agent" && \  
java -jar /home/agent/vs-agent.jar \  
     -Djava.util.logging.config.file=/home/agent/logging.properties \  
     propsfile=/home/agent/client.properties

vsagent manager

java -jar /app/agent/vs-agent.jar \  
     -Djava.util.logging.config.file=/app/agent/logging.properties \  
     propsfile=/app/agent/client.properties
java -jar vs-agent.jar -Djava.util.logging.config.file=logging.properties propsfile=client.properties

Docker Compose

services:  
  agent:  
    hostname: my-docker-vaultspeed-agent # displayed in VaultSpeed portal after "ping"  
    build:  
      dockerfile: Dockerfile  
    # map the local agent folder to the container's /home/agent folder    
    # WARNING: make sure you download and unzip the agent package from your VaultSpeed instance here.
	volumes:  
      - ./agent:/home/agent

Start the agent

docker compose up

# type ctrl-c to stop

-or-

# run in background
docker compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment