11# git-launcher
22
33` git-launcher ` runs a workload from one exact Git commit inside a dstack
4- container. You give it a Git repository URL, a full commit SHA, and a checkout
5- directory. It fetches that commit, verifies that ` HEAD ` is exactly the commit
6- you configured, and then hands control to the workload's entry script.
4+ container. You give it a config file with a Git repository URL, a full commit
5+ SHA, and a checkout directory. It fetches that commit, verifies that ` HEAD ` is
6+ exactly the commit you configured, and then hands control to the workload's
7+ entry script.
78
89Use it when you want a generic launcher image whose image digest is stable and
910auditable, while the workload identity comes from an attested config file.
@@ -48,7 +49,9 @@ Do not use it when:
4849
4950On startup, ` git-launcher ` :
5051
51- 1 . Parses a line-oriented config file. The config is parsed, not sourced.
52+ 1 . Parses a line-oriented config file. By default it reads
53+ ` /etc/git-launcher/config.conf ` ; you can pass a different path for local
54+ testing. The config is parsed, not sourced.
52552 . Rejects missing required keys, unknown keys, short SHAs, branches, and tags.
53563 . Creates or reuses ` WORK_DIR ` if it is a Git checkout for the same ` REPO_URL ` .
54574 . Runs ` git fetch --tags --prune origin ` .
@@ -120,7 +123,9 @@ Rules:
120123## Run locally
121124
122125Local runs require ` bash ` , ` git ` , and standard coreutils. After writing a
123- config file for a real workload commit, run the launcher script directly:
126+ config file for a real workload commit, run the launcher script directly.
127+ Pass the path explicitly when your local config is not at the container default
128+ ` /etc/git-launcher/config.conf ` :
124129
125130``` sh
126131./bin/git-launcher ./config.conf
@@ -163,7 +168,6 @@ or the workload pin changes the attestation.
163168services:
164169 workload:
165170 image: docker.io/<org>/git-launcher@sha256:<launcher-digest>
166- command: ["/etc/git-launcher/config.conf"]
167171 configs:
168172 - source: pin
169173 target: /etc/git-launcher/config.conf
@@ -201,8 +205,7 @@ pin, build a small downstream image:
201205
202206` ` ` dockerfile
203207FROM docker.io/<org>/git-launcher@sha256:<launcher-digest>
204- COPY web-app.conf /etc/git-launcher/config.conf
205- CMD ["/etc/git-launcher/config.conf"]
208+ COPY config.conf /etc/git-launcher/config.conf
206209` ` `
207210
208211Deploy the derived image by its own digest. The derived image digest now binds
@@ -218,9 +221,8 @@ For local iteration, bind-mounting the config is convenient:
218221services:
219222 workload:
220223 image: docker.io/<org>/git-launcher@sha256:<launcher-digest>
221- command: ["/etc/git-launcher/config.conf"]
222224 volumes:
223- - ./web-app .conf:/etc/git-launcher/config.conf:ro
225+ - ./config .conf:/etc/git-launcher/config.conf:ro
224226 - workload-checkout:/var/lib/git-launcher
225227 - /var/run/dstack.sock:/var/run/dstack.sock
226228 restart: unless-stopped
0 commit comments