Skip to content

Conversation

axel7083
Copy link

Description

Given a compose file

name: flask-compose
services:
  backend:
    build:
      context: flask

the podlet compose --kube would give the following

# flask-compose.kube
[Kube]
PodmanArgs=--build=true
Yaml=flask-compose-kube.yaml

[Service]
WorkingDirectory=/home/axel7083/github/fosdem2025/demo-quadlet

---

# flask-compose-kube.yaml
apiVersion: v1
kind: Pod
metadata:
 name: flask-compose
spec:
 containers:
 - image: flask
   name: backend

How ?

  1. Detect if Compose spec has services with the build option.
  2. Add the WorkingDirectory to the [Service] section of the systemd unit (take the parent of the compose file).
  3. Adding the --build true to the podman args

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant