Skip to content

feat: partial support of build field in compose for kube quadlets#139

Draft
axel7083 wants to merge 4 commits intocontainers:mainfrom
axel7083:fix/tentative-kube-build
Draft

feat: partial support of build field in compose for kube quadlets#139
axel7083 wants to merge 4 commits intocontainers:mainfrom
axel7083:fix/tentative-kube-build

Conversation

@axel7083
Copy link
Copy Markdown

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